# `./fio-stl/162 brotli.h`

4 public symbols.

### Functions

#### `fio_brotli_decompress`

```c
size_t fio_brotli_decompress(void *out, size_t out_len, const void *in, size_t in_len)
```

Decompresses Brotli-compressed data (RFC 7932).

Returns:
 - On success: decompressed byte count (<= out_len).
 - On buffer too small: the REQUIRED buffer size (> out_len).
 - On corrupt/invalid data: 0.
 - When out==NULL or out_len==0: performs a header scan summing MLEN
   values and returns the required size (0 if data is corrupt).
   This allows callers to query the decompressed size without allocating.

_Symbol type:_ `function`

#### `fio_brotli_decompress_bound`

```c
inline size_t fio_brotli_decompress_bound(size_t in_len)
```

Conservative upper bound on decompressed size for a Brotli stream.

_Symbol type:_ `function`

#### `fio_brotli_compress`

```c
size_t fio_brotli_compress(void *out, size_t out_len, const void *in, size_t in_len, int quality)
```

Compresses data using Brotli (RFC 7932).

Returns compressed length on success, 0 on error.
quality: 1-6 (1=fast greedy, 3-4=lazy matching, 5-6=hash chain + context
modeling + static dictionary). Caller provides output buffer sized via
fio_brotli_compress_bound().

_Symbol type:_ `function`

#### `fio_brotli_compress_bound`

```c
inline size_t fio_brotli_compress_bound(size_t in_len)
```

Upper bound on Brotli compressed output size.

_Symbol type:_ `function`

-----------------------------------------------------
