4#ifndef PROTOCORE_MULTIPART_H
5#define PROTOCORE_MULTIPART_H
76 const char *(*get_field)(uint8_t *,
const MultipartBody *,
const char *);
#define MAX_MULTIPART_PARTS
Maximum simultaneously parsed multipart parts per request.
proto_bool protocore_multipart_parse(uint8_t *work, HttpReq *req, MultipartBody *mp)
Scan req's body as multipart/form-data, reading the boundary from.
const char * protocore_multipart_get_field(uint8_t *work, const MultipartBody *mp, const char *field)
The data pointer of the first part whose name matches field, or.
PROTOCORE_NS MultipartNs Multipart PROTOCORE_UNUSED
Module namespace.
#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.
Container for all parsed parts of a multipart body.
int part_count
Number of valid entries in parts[].
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* parse)(uint8_t *, HttpReq *, MultipartBody *)
One parsed part from a multipart body.
const char * data
Part body (null-terminated in-place).
const char * type
Content-Type of this part, or nullptr.
size_t data_len
Part body length in bytes (not counting the null).
const char * name
Form field name from Content-Disposition, or nullptr.
const char * filename
Upload filename from Content-Disposition, or nullptr.
#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