4#ifndef PROTOCORE_HPACK_PRIM_H
5#define PROTOCORE_HPACK_PRIM_H
37 size_t (*encode_int)(uint8_t *, uint8_t *, size_t, uint8_t, uint8_t, uint32_t);
38 proto_bool (*decode_int)(uint8_t *,
const uint8_t *, size_t, uint8_t,
size_t *, uint32_t *);
39 size_t (*huff_encode)(uint8_t *, uint8_t *, size_t,
const char *, size_t);
40 size_t (*huff_len)(uint8_t *,
const char *, size_t);
41 proto_bool (*huff_decode)(uint8_t *,
const uint8_t *, size_t,
char *, size_t,
size_t *);
42 proto_bool (*decode_str)(uint8_t *,
const uint8_t *, size_t,
size_t *,
char *, size_t,
size_t *);
43 size_t (*encode_str)(uint8_t *, uint8_t *, size_t,
const char *, size_t);
70 size_t *consumed, uint32_t *value);
113 size_t cap,
size_t *out_len);
proto_bool protocore_hpack_prim_decode_int(uint8_t *work, const uint8_t *in, size_t len, uint8_t prefix_bits, size_t *consumed, uint32_t *value)
The same integer back; sets consumed and value, false if malformed.
size_t protocore_hpack_prim_huff_len(uint8_t *work, const char *s, size_t n)
The Huffman byte length of s without encoding it, which is what.
proto_bool protocore_hpack_prim_decode_str(uint8_t *work, const uint8_t *block, size_t len, size_t *pos, char *out, size_t cap, size_t *out_len)
A length-prefixed string literal (H bit at 0x80 + a 7-bit length .
size_t protocore_hpack_prim_huff_encode(uint8_t *work, uint8_t *out, size_t cap, const char *s, size_t n)
Huffman-encode n bytes of s (RFC 7541 Appendix B); bytes written,.
size_t protocore_hpack_prim_encode_str(uint8_t *work, uint8_t *out, size_t cap, const char *s, size_t n)
The same literal out, Huffman-coded when that is the shorter of the .
size_t protocore_hpack_prim_encode_int(uint8_t *work, uint8_t *out, size_t cap, uint8_t prefix_bits, uint8_t flags, uint32_t value)
A prefix-prefix_bits integer with the high flags bits set in byte 0.
PROTOCORE_NS HpackPrimNs HpackPrim PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_hpack_prim_huff_decode(uint8_t *work, const uint8_t *in, size_t n, char *out, size_t cap, size_t *out_len)
Huffman-decode n bytes into out; sets out_len, false on a bad code.
#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.
size_t(* encode_int)(uint8_t *, uint8_t *, size_t, uint8_t, uint8_t, uint32_t)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS