35#define PROTOCORE_SCP_ACK_OK 0
36#define PROTOCORE_SCP_ACK_WARN 1
37#define PROTOCORE_SCP_ACK_ERROR 2
48 ScpMode (*
parse_cmd)(
const uint8_t *,
const char *, size_t,
char *, size_t);
49 embed_bool (*
parse_cline)(
const uint8_t *,
const char *, size_t, uint32_t *, uint64_t *,
char *, size_t);
50 size_t (*
build_cline)(
const uint8_t *, uint32_t, uint64_t,
const char *,
char *, size_t);
76 uint64_t *size_out,
char *name_out,
size_t name_cap);
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#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.
EMBED_ENUM_BYTE(ScpMode, SCP_MODE_INVALID=0, SCP_MODE_SINK, SCP_MODE_SOURCE)
The role of an scp invocation, parsed from the exec command.
embed_bool protocore_scp_parse_cline(const uint8_t *work, const char *line, size_t len, uint32_t *mode_out, uint64_t *size_out, char *name_out, size_t name_cap)
Parse a control line C<mode> <size> <name> (a trailing ' ' .
ScpMode protocore_scp_parse_cmd(const uint8_t *work, const char *cmd, size_t cmd_len, char *path_out, size_t path_cap)
Parse an exec command scp [-v] [-r] [-p] [-d] -t|-f <path> into .
size_t protocore_scp_build_cline(const uint8_t *work, uint32_t mode, uint64_t size, const char *name, char *out, size_t cap)
Build a control line C<mode> <size> <name>\n for a source .
Dispatch table. Addressed by offset, so the layout is asserted below.
embed_bool(* parse_cline)(const uint8_t *, const char *, size_t, uint32_t *, uint64_t *, char *, size_t)
size_t(* build_cline)(const uint8_t *, uint32_t, uint64_t, const char *, char *, size_t)
ScpMode(* parse_cmd)(const uint8_t *, const char *, size_t, char *, size_t)