From 45b0b2d85fbc284453056c0768c7646df1de9b52 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 2 Oct 2024 15:42:10 -0600 Subject: lib9p: doc comments --- lib9p/include/lib9p/9p.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib9p') diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h index 1c8f2e5..2712998 100644 --- a/lib9p/include/lib9p/9p.h +++ b/lib9p/include/lib9p/9p.h @@ -42,6 +42,7 @@ int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, . * * @return required size, or -1 on error * + * @errno LINUX_EOPNOTSUPP: message has unknown type * @errno LINUX_EBADMSG: message is wrong size for content * @errno LINUX_EBADMSG: message contains invalid UTF-8 * @errno LINUX_EBADMSG: message contains a bitfield with unknown bits @@ -55,6 +56,9 @@ ssize_t lib9p_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes); * Emits an error (return 0, set ctx->err_num and ctx->err_msg) if a * string contains invalid UTF-8 or a nul-byte. * + * lib9p_unmarshal does no validation; you must run lib9p_validate() + * first. + * * @param ctx : negotiated protocol parameters, where to record errors * @param net_bytes : the complete message, starting with the "size[4]" * @@ -68,6 +72,9 @@ void lib9p_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes, /** * Marshal a `struct lib9p_msg_{typ}` structure into a byte-array. * + * lib9p_marshal does no validation; it trusts that the programmer + * won't give it garbage input. + * * @param ctx : negotiated protocol parameters, where to record errors * @param typ : the message type * @param tag : the message-ID tag -- cgit v1.2.3-2-g168b