From ab9103440ade87509a1a3bd1eaad0b5396a89d1e Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 17 May 2025 03:20:11 -0600 Subject: Pull UTF-8 decoding into libmisc/utf8.c --- lib9p/core_generated.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib9p/core_generated.c') diff --git a/lib9p/core_generated.c b/lib9p/core_generated.c index 81ace7d..e19f6e6 100644 --- a/lib9p/core_generated.c +++ b/lib9p/core_generated.c @@ -6,11 +6,11 @@ #include #include +#include #include #include "core_tables.h" -#include "core_utf8.h" /* utilities ******************************************************************/ #if CONFIG_9P_ENABLE_9P2000 @@ -234,7 +234,7 @@ static const lib9p_lock_flags_t lock_flags_masks[LIB9P_VER_NUM] = { { \ size_t len = n; \ VALIDATE_NET_BYTES(len); \ - if (!is_valid_utf8_without_nul(&net_bytes[net_offset-len], len)) \ + if (!utf8_is_valid_without_nul(&net_bytes[net_offset-len], len)) \ return lib9p_error(ctx, LIB9P_ERRNO_L_EBADMSG, "message contains invalid UTF-8"); \ } #define RESERVE_HOST_BYTES(n) \ @@ -6507,7 +6507,7 @@ static bool marshal_Rswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Rswrite *val fmt_print_tag(w, ctx, &self->tag); fmt_print_str(w, " count="); fmt_print_base10(w, self->count); - if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) { + if (utf8_is_valid_without_nul((uint8_t *)self->data, (size_t)self->count)) { fmt_print_str(w, " data="); fmt_print_qmem(w, self->data, self->count < 50 ? self->count : 50); if (self->count > 50) @@ -6528,7 +6528,7 @@ static bool marshal_Rswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Rswrite *val fmt_print_base10(w, self->offset); fmt_print_str(w, " count="); fmt_print_base10(w, self->count); - if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) { + if (utf8_is_valid_without_nul((uint8_t *)self->data, (size_t)self->count)) { fmt_print_str(w, " data="); fmt_print_qmem(w, self->data, self->count < 50 ? self->count : 50); if (self->count > 50) @@ -6763,7 +6763,7 @@ static bool marshal_Rswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Rswrite *val fmt_print_tag(w, ctx, &self->tag); fmt_print_str(w, " count="); fmt_print_base10(w, self->count); - if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) { + if (utf8_is_valid_without_nul((uint8_t *)self->data, (size_t)self->count)) { fmt_print_str(w, " data="); fmt_print_qmem(w, self->data, self->count < 50 ? self->count : 50); if (self->count > 50) @@ -6846,7 +6846,7 @@ static bool marshal_Rswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Rswrite *val fmt_print_tag(w, ctx, &self->tag); fmt_print_str(w, " count="); fmt_print_base10(w, self->count); - if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) { + if (utf8_is_valid_without_nul((uint8_t *)self->data, (size_t)self->count)) { fmt_print_str(w, " data="); fmt_print_qmem(w, self->data, self->count < 50 ? self->count : 50); if (self->count > 50) @@ -7445,7 +7445,7 @@ static bool marshal_Rswrite(struct lib9p_ctx *ctx, struct lib9p_msg_Rswrite *val fmt_print_str(w, " ]"); fmt_print_str(w, " count="); fmt_print_base10(w, self->count); - if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) { + if (utf8_is_valid_without_nul((uint8_t *)self->data, (size_t)self->count)) { fmt_print_str(w, " data="); fmt_print_qmem(w, self->data, self->count < 50 ? self->count : 50); if (self->count > 50) -- cgit v1.2.3-2-g168b From 037df4afccb4577351f8155a0b9a36825ac7eb15 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 17 May 2025 13:06:51 -0600 Subject: Tidy #includes: We don't use PRI* anymore --- lib9p/core_generated.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib9p/core_generated.c') diff --git a/lib9p/core_generated.c b/lib9p/core_generated.c index e19f6e6..6e3633f 100644 --- a/lib9p/core_generated.c +++ b/lib9p/core_generated.c @@ -1,8 +1,7 @@ /* Generated by `lib9p/core.gen lib9p/idl/0000-uninitialized.9p lib9p/idl/2002-9P2000.9p lib9p/idl/2003-9P2000.p9p.9p lib9p/idl/2005-9P2000.u.9p lib9p/idl/2010-9P2000.L.9p lib9p/idl/2012-9P2000.e.9p`. DO NOT EDIT! */ -#include /* for size_t */ -#include /* for PRI* macros */ -#include /* for memset() */ +#include /* for size_t */ +#include /* for memset() */ #include #include -- cgit v1.2.3-2-g168b