4#ifndef PROTOCORE_QPACK_H
5#define PROTOCORE_QPACK_H
39typedef proto_bool (*
QpackEmitFn)(
void *ctx,
const char *name,
size_t name_len,
const char *value,
size_t value_len);
44 size_t (*encode_prefix)(uint8_t *, uint8_t *, size_t);
45 size_t (*encode_header)(uint8_t *, uint8_t *, size_t,
const char *, size_t,
const char *, size_t);
70 const char *value,
size_t value_len);
86typedef proto_bool (*
QpackEmitFn)(
void *ctx,
const char *name,
size_t name_len,
const char *value,
size_t value_len);
#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.
proto_bool protocore_qpack_decode(uint8_t *work, const uint8_t *block, size_t len, char *scratch, size_t scratch_cap, QpackEmitFn emit, void *ctx)
Decode a whole QPACK field section (prefix + representations), .
PROTOCORE_NS QpackNs Qpack PROTOCORE_UNUSED
Module namespace.
size_t protocore_qpack_encode_header(uint8_t *work, uint8_t *out, size_t cap, const char *name, size_t name_len, const char *value, size_t value_len)
Encode one header field (server side): a full static match -> .
size_t protocore_qpack_encode_prefix(uint8_t *work, uint8_t *out, size_t cap)
Write the encoded field-section prefix for a static-only section. .
proto_bool(* QpackEmitFn)(void *ctx, const char *name, size_t name_len, const char *value, size_t value_len)
Callback invoked for each decoded header; return false to abort the decode.
Dispatch table. Addressed by offset, so the layout is asserted below.
size_t(* encode_prefix)(uint8_t *, uint8_t *, size_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