#ifndef KEKS_DEC_H
#define KEKS_DEC_H

#include <stddef.h>

#include "atom.h" // IWYU pragma: keep // struct KEKSAtom
#include "err.h"

// TEXINFO: KEKSAtomDecode
// @deftypefun {enum KEKSErr} KEKSAtomDecode ( @
//     size_t *got, @
//     struct KEKSAtom *atom, @
//     const unsigned char *buf, @
//     const size_t len)
// Decode the @ref{KEKSAtom, @var{atom}} from provided @var{buf} of
// length @var{len}. If error is @code{KEKSErrNotEnough}, then @var{got}
// will contain how many bytes is missing in the buffer for full atom
// decoding. Otherwise it will contain the full atom's size.
// @end deftypefun
enum KEKSErr
KEKSAtomDecode(
    size_t *got,
    struct KEKSAtom *,
    const unsigned char *buf,
    const size_t len);

#endif // KEKS_DEC_H
