diff options
50 files changed, 594 insertions, 601 deletions
diff --git a/.editorconfig b/.editorconfig index c632054..d2b92ed 100644 --- a/.editorconfig +++ b/.editorconfig @@ -67,10 +67,10 @@ _mode = 9p-idl [lib9p/tests/*.explog] _mode = 9p-log -[{lib9p/tests/test_server/static.h.gen,lib9p/tests/test_compile.c.gen}] +[lib9p/tests/test_server/static.h.gen] _mode = sh -[{lib9p/linux-errno.txt.gen,lib9p/tests/runtest,lib9p/tests/testclient-p9p}] +[{lib9p/linux-errno.txt.gen,lib9p/tests/test_compile.c.gen,lib9p/tests/runtest,lib9p/tests/testclient-p9p}] _mode = bash [{lib9p/core.gen,lib9p/idl/2010-9P2000.L.9p.gen}] diff --git a/GNUmakefile b/GNUmakefile index e5e59b2..9836b33 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -57,12 +57,19 @@ generate/files += build-aux/sources.mk ifeq ($(INNER),) nonsource/files = $(generate/files) nonsource/files += 3rd-party/COPYING.wiznet-dhcp.txt +# 100644 blob/regular file +# 100755 blob/executable file +# 120000 blob/symlink +# 160000 commit (submodule) +# 040000 tree (directory) build-aux/sources.mk: $(if $(wildcard .git),FORCE) - git ls-files | grep -vFx $(foreach f,$(nonsource/files),-e $f) \ - | sed 's,^,$(CURDIR)/,' | xargs editorconfig \ - | sed -nE -e 's,\[$(CURDIR)/(.*)\],\1,p' -e 's/^_mode=//p' \ - | sed -E '{N;s/(.*)\n(.*)/sources_\2 += \1/;}' \ - | sort \ + git ls-files --format='%(objectmode) %(path)' \ + | sed -n 's/^100... //p' \ + | grep -vFx $(foreach f,$(nonsource/files),-e $f) \ + | sed 's,^,$(CURDIR)/,' | xargs editorconfig \ + | sed -nE -e 's,\[$(CURDIR)/(.*)\],\1,p' -e 's/^_mode=//p' \ + | sed -E '{N;s/(.*)\n(.*)/sources_\2 += \1/;}' \ + | sort \ >$@.tmp if ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi @echo '################################################################################' @@ -117,7 +124,7 @@ lint: lint/bin: build build-aux/lint-bin ./build-aux/lint-bin $(foreach t,$(build_types),build/rp2040-$t/cmd/sbc_harness/sbc_harness.elf) lint/all: lint/%: build-aux/lint-generic build-aux/get-dscname - ./build-aux/lint-generic '%s\n' $(sources_$*) + ./build-aux/lint-generic $(sources_$*) lint/unknown: lint/%: build-aux/lint-unknown ./build-aux/lint-unknown $(sources_$*) .PHONY: lint lint/% diff --git a/build-aux/lint-generic b/build-aux/lint-generic index 70e814a..d982527 100755 --- a/build-aux/lint-generic +++ b/build-aux/lint-generic @@ -14,11 +14,6 @@ err() { r=0 for filename in "$@"; do - if ! { [ -f "$filename" ] && ! [ -h "$filename" ]; }; then - # Ignore non-files - continue - fi - # File header ########################################################## shebang="$(sed -n '1{/^#!/{/^#!\/hint\//q; p;};}' "$filename")" diff --git a/build-aux/lint-unknown b/build-aux/lint-unknown index dda9541..bc23a81 100755 --- a/build-aux/lint-unknown +++ b/build-aux/lint-unknown @@ -14,11 +14,6 @@ err() { r=0 for filename in "$@"; do - if ! { [ -f "$filename" ] && ! [ -h "$filename" ]; }; then - # Ignore non-files - continue - fi - err "$filename" 'cannot lint unknown file type' done exit $r diff --git a/cmd/sbc_harness/fs_harness_flash_bin.c b/cmd/sbc_harness/fs_harness_flash_bin.c index 3c3fa16..5e6f49c 100644 --- a/cmd/sbc_harness/fs_harness_flash_bin.c +++ b/cmd/sbc_harness/fs_harness_flash_bin.c @@ -166,7 +166,7 @@ static struct lib9p_srv_stat flash_file_stat(struct flash_file *self, struct lib }; } static void flash_file_wstat(struct flash_file *self, struct lib9p_srv_ctx *ctx, - struct lib9p_srv_stat) { + struct lib9p_srv_stat) { assert(self); assert(ctx); diff --git a/cmd/sbc_harness/fs_harness_uptime_txt.c b/cmd/sbc_harness/fs_harness_uptime_txt.c index 97246ea..339b410 100644 --- a/cmd/sbc_harness/fs_harness_uptime_txt.c +++ b/cmd/sbc_harness/fs_harness_uptime_txt.c @@ -5,9 +5,9 @@ */ #include <libhw/generic/alarmclock.h> -#include <util9p/static.h> #include <libmisc/alloc.h> /* for heap_alloc(), free() */ -#include <libmisc/fmt.h> /* for fmt_snprint() */ +#include <libmisc/fmt.h> /* for fmt_snprint() */ +#include <util9p/static.h> #include "fs_harness_uptime_txt.h" diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c index 143bae0..71c39b2 100644 --- a/cmd/sbc_harness/main.c +++ b/cmd/sbc_harness/main.c @@ -8,8 +8,8 @@ #include <string.h> /* libc: for strlen() */ /* pico-sdk */ -#include <pico/stdio_uart.h> /* pico-sdk:pico_stdio_uart: for stdio_uart_init() */ #include <hardware/flash.h> /* pico-sdk:hardware_flash: for flash_get_unique_id() */ +#include <pico/stdio_uart.h> /* pico-sdk:pico_stdio_uart: for stdio_uart_init() */ /* our OS */ #include <libcr/coroutine.h> @@ -19,9 +19,9 @@ #include <libhw/w5500.h> /* our application libraries */ +#include <lib9p/srv.h> #include <libdhcp/client.h> #include <libusb/usb_common.h> -#include <lib9p/srv.h> #include <util9p/static.h> /* our utility libraries */ @@ -30,10 +30,10 @@ #include <libmisc/log.h> /* local headers */ -#include "usb_keyboard.h" -#include "static.h" #include "fs_harness_flash_bin.h" #include "fs_harness_uptime_txt.h" +#include "static.h" +#include "usb_keyboard.h" /* configuration **************************************************************/ diff --git a/cmd/sbc_harness/usb_keyboard.c b/cmd/sbc_harness/usb_keyboard.c index 0573dba..dcd4465 100644 --- a/cmd/sbc_harness/usb_keyboard.c +++ b/cmd/sbc_harness/usb_keyboard.c @@ -6,9 +6,9 @@ #include <tusb.h> +#include <libmisc/macro.h> #include <libusb/tusb_helpers.h> /* for TUD_ENDPOINT_IN */ #include <libusb/usb_common.h> -#include <libmisc/macro.h> #include "usb_keyboard.h" @@ -20,7 +20,7 @@ static uint8_t const hid_report_descriptor_keyboard[] = { TUD_HID_REPORT_DESC_KE static uint8_t kbd_ifc = 0; -void usb_keyboard_init() { +void usb_keyboard_init(void) { if (kbd_ifc) return; @@ -85,23 +85,20 @@ COROUTINE usb_keyboard_cr(void *_chan) { * ยง6.2.2 "Report Descriptor") for the given index. */ uint8_t const *tud_hid_descriptor_report_cb(uint8_t index) { - static uint8_t const *reports[] = { - hid_report_descriptor_keyboard, - }; - if (index >= TU_ARRAY_SIZE(reports)) - return NULL; - return reports[index]; + static uint8_t const *reports[] = { + hid_report_descriptor_keyboard, + }; + if (index >= TU_ARRAY_SIZE(reports)) + return NULL; + return reports[index]; } -uint16_t tud_hid_get_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen) -{ +uint16_t tud_hid_get_report_cb(uint8_t LM_UNUSED(instance), + uint8_t LM_UNUSED(report_id), + hid_report_type_t LM_UNUSED(report_type), + uint8_t* LM_UNUSED(buffer), + uint16_t LM_UNUSED(reqlen)) { // TODO not implemented - (void) instance; - (void) report_id; - (void) report_type; - (void) buffer; - (void) reqlen; - return 0; } diff --git a/lib9p/core.c b/lib9p/core.c index 464b31d..942db05 100644 --- a/lib9p/core.c +++ b/lib9p/core.c @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <stdarg.h> /* for va_* */ -#include <string.h> /* for strlen(), strnlen(), strncpy(), memcmp(), memset() */ +#include <stdarg.h> /* for va_* */ +#include <string.h> /* for strlen(), strnlen(), strncpy(), memcmp(), memset() */ #include <libmisc/assert.h> /* for assert() */ #include <libmisc/endian.h> /* for uint32le_decode() */ @@ -103,11 +103,11 @@ const char *lib9p_msgtype_str(enum lib9p_version ver, enum lib9p_msg_type typ) { /* main message functions *****************************************************/ void fmt_print_lib9p_msg(lo_interface fmt_dest w, struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body) { - assert(ctx); - assert_ver(ctx->version); - assert_typ(typ); - assert(_lib9p_table_msg[ctx->version][typ].print); - _lib9p_table_msg[ctx->version][typ].print(w, ctx, body); + assert(ctx); + assert_ver(ctx->version); + assert_typ(typ); + assert(_lib9p_table_msg[ctx->version][typ].print); + _lib9p_table_msg[ctx->version][typ].print(w, ctx, body); } #define _lib9p_validate(LOW_TYP_BIT, ERRMSG, TABLE) do { \ diff --git a/lib9p/core_gen/c.py b/lib9p/core_gen/c.py index 60ceb70..0947ec2 100644 --- a/lib9p/core_gen/c.py +++ b/lib9p/core_gen/c.py @@ -23,17 +23,16 @@ def gen_c(versions: set[str], typs: list[idl.UserType]) -> str: ret = f"""/* Generated by `{' '.join(sys.argv)}`. DO NOT EDIT! */ -#include <stddef.h> /* for size_t */ -#include <inttypes.h> /* for PRI* macros */ -#include <string.h> /* for memset() */ +#include <stddef.h> /* for size_t */ +#include <string.h> /* for memset() */ #include <libmisc/assert.h> #include <libmisc/endian.h> +#include <libmisc/utf8.h> #include <lib9p/core.h> #include "core_tables.h" -#include "core_utf8.h" """ # utilities ################################################################ ret += """ diff --git a/lib9p/core_gen/c_fmt_print.py b/lib9p/core_gen/c_fmt_print.py index eaacddb..7a0a9d3 100644 --- a/lib9p/core_gen/c_fmt_print.py +++ b/lib9p/core_gen/c_fmt_print.py @@ -112,7 +112,7 @@ def gen_c_fmt_print(versions: set[str], typs: list[idl.UserType]) -> str: cnt_str = f"self->{member.cnt.membname}" cnt_typ = c9util.typename(member.cnt.typ) if member.typ.static_size == 1: # SPECIAL (data) - ret += f"\tif (is_valid_utf8_without_nul((uint8_t *)self->{member.membname}, (size_t){cnt_str})) {{\n" + ret += f"\tif (utf8_is_valid_without_nul((uint8_t *)self->{member.membname}, (size_t){cnt_str})) {{\n" ret += f'\t\tfmt_print_str(w, " {member.membname}=");\n' ret += f"\t\tfmt_print_qmem(w, self->{member.membname}, {cnt_str} < 50 ? {cnt_str} : 50);\n" ret += f"\t\tif ({cnt_str} > 50)\n" diff --git a/lib9p/core_gen/c_validate.py b/lib9p/core_gen/c_validate.py index 9c55d8d..e7a4017 100644 --- a/lib9p/core_gen/c_validate.py +++ b/lib9p/core_gen/c_validate.py @@ -66,7 +66,7 @@ def gen_c_validate(versions: set[str], typs: list[idl.UserType]) -> str: "\t{\n" "\t\tsize_t len = n;\n" "\t\tVALIDATE_NET_BYTES(len);\n" - "\t\tif (!is_valid_utf8_without_nul(&net_bytes[net_offset-len], len))\n" + "\t\tif (!utf8_is_valid_without_nul(&net_bytes[net_offset-len], len))\n" f'\t\t\treturn lib9p_error(ctx, {c9util.IDENT("ERRNO_L_EBADMSG")}, "message contains invalid UTF-8");\n' "\t}\n" ) diff --git a/lib9p/core_gen/h.py b/lib9p/core_gen/h.py index acf8415..c7c832b 100644 --- a/lib9p/core_gen/h.py +++ b/lib9p/core_gen/h.py @@ -162,7 +162,6 @@ def gen_h(versions: set[str], typs: list[idl.UserType]) -> str: #ifndef _LIB9P_CORE_H_ \t#error Do not include <lib9p/_core_generated.h> directly; include <lib9p/core.h> instead #endif - """ id2typ: dict[int, idl.Message] = {} for msg in [msg for msg in typs if isinstance(msg, idl.Message)]: diff --git a/lib9p/core_generated.c b/lib9p/core_generated.c index 81ace7d..6e3633f 100644 --- a/lib9p/core_generated.c +++ b/lib9p/core_generated.c @@ -1,16 +1,15 @@ /* 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 <stddef.h> /* for size_t */ -#include <inttypes.h> /* for PRI* macros */ -#include <string.h> /* for memset() */ +#include <stddef.h> /* for size_t */ +#include <string.h> /* for memset() */ #include <libmisc/assert.h> #include <libmisc/endian.h> +#include <libmisc/utf8.h> #include <lib9p/core.h> #include "core_tables.h" -#include "core_utf8.h" /* utilities ******************************************************************/ #if CONFIG_9P_ENABLE_9P2000 @@ -234,7 +233,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 +6506,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 +6527,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 +6762,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 +6845,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 +7444,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) diff --git a/lib9p/core_include/lib9p/_core_generated.h b/lib9p/core_include/lib9p/_core_generated.h index 5b9a67d..d1ecd6e 100644 --- a/lib9p/core_include/lib9p/_core_generated.h +++ b/lib9p/core_include/lib9p/_core_generated.h @@ -4,7 +4,6 @@ #error Do not include <lib9p/_core_generated.h> directly; include <lib9p/core.h> instead #endif - /* config *********************************************************************/ #include "config.h" diff --git a/lib9p/core_utf8.h b/lib9p/core_utf8.h deleted file mode 100644 index 2c451e0..0000000 --- a/lib9p/core_utf8.h +++ /dev/null @@ -1,36 +0,0 @@ -/* lib9p/core_utf8.h - Internal UTF-8 validation - * - * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -#ifndef _LIB9P_CORE_UTF8_H_ -#define _LIB9P_CORE_UTF8_H_ - -#include <stddef.h> /* for size_t */ -#include <stdint.h> /* for uint{n}_t */ - -static inline bool _is_valid_utf8(uint8_t *str, size_t len, bool forbid_nul) { - uint32_t ch; - uint8_t chlen; - for (size_t pos = 0; pos < len;) { - if ((str[pos] & 0b10000000) == 0b00000000) { ch = str[pos] & 0b01111111; chlen = 1; } - else if ((str[pos] & 0b11100000) == 0b11000000) { ch = str[pos] & 0b00011111; chlen = 2; } - else if ((str[pos] & 0b11110000) == 0b11100000) { ch = str[pos] & 0b00001111; chlen = 3; } - else if ((str[pos] & 0b11111000) == 0b11110000) { ch = str[pos] & 0b00000111; chlen = 4; } - else return false; - if ((ch == 0 && (chlen != 1 || forbid_nul)) || pos + chlen > len) return false; - for (uint8_t i = 1; i < chlen; i++) { - if ((str[pos+i] & 0b11000000) != 0b10000000) return false; - ch = (ch << 6) | (str[pos+i] & 0b00111111); - } - if (ch > 0x10FFFF) return false; - pos += chlen; - } - return true; -} - -#define is_valid_utf8(str, len) _is_valid_utf8(str, len, false) -#define is_valid_utf8_without_nul(str, len) _is_valid_utf8(str, len, true) - -#endif /* _LIB9P_CORE_UTF8_H_ */ diff --git a/lib9p/srv.c b/lib9p/srv.c index 18165e0..56fc3ec 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <inttypes.h> /* for PRI* */ #include <limits.h> /* for SSIZE_MAX, not set by newlib */ #include <stddef.h> /* for size_t */ #include <stdlib.h> /* for malloc() */ @@ -16,11 +15,11 @@ #include <libcr/coroutine.h> #include <libcr_ipc/chan.h> #include <libcr_ipc/mutex.h> +#include <libhw/generic/net.h> #include <libmisc/alloc.h> #include <libmisc/assert.h> #include <libmisc/endian.h> #include <libmisc/map.h> -#include <libhw/generic/net.h> #define LOG_NAME 9P_SRV #include <libmisc/log.h> @@ -739,7 +738,7 @@ static void handle_Tversion(struct srv_req *ctx, if (req->max_msg_size < min_msg_size) { lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_EDOM, "requested max_msg_size is less than minimum for ", lib9p_version_str(version), - " (", req->max_msg_size, " < ", min_msg_size,")"); + " (", req->max_msg_size, " < ", min_msg_size, ")"); goto tversion_return; } diff --git a/lib9p/tests/test_compile.c b/lib9p/tests/test_compile.c index e814bf9..6d7fb50 100644 --- a/lib9p/tests/test_compile.c +++ b/lib9p/tests/test_compile.c @@ -2,1254 +2,1254 @@ #include <lib9p/core.h> int main(void) { - [[maybe_unused]] uint64_t x; + [[maybe_unused]] uint64_t x; #ifdef LIB9P_B4_FALSE - x = LIB9P_B4_FALSE; + x = LIB9P_B4_FALSE; #endif #ifdef LIB9P_B4_TRUE - x = LIB9P_B4_TRUE; + x = LIB9P_B4_TRUE; #endif #ifdef LIB9P_DM_APPEND - x = LIB9P_DM_APPEND; + x = LIB9P_DM_APPEND; #endif #ifdef LIB9P_DM_AUTH - x = LIB9P_DM_AUTH; + x = LIB9P_DM_AUTH; #endif #ifdef LIB9P_DM_DEVICE - x = LIB9P_DM_DEVICE; + x = LIB9P_DM_DEVICE; #endif #ifdef LIB9P_DM_DIR - x = LIB9P_DM_DIR; + x = LIB9P_DM_DIR; #endif #ifdef LIB9P_DM_EXCL - x = LIB9P_DM_EXCL; + x = LIB9P_DM_EXCL; #endif #ifdef LIB9P_DM_GROUP_R - x = LIB9P_DM_GROUP_R; + x = LIB9P_DM_GROUP_R; #endif #ifdef LIB9P_DM_GROUP_W - x = LIB9P_DM_GROUP_W; + x = LIB9P_DM_GROUP_W; #endif #ifdef LIB9P_DM_GROUP_X - x = LIB9P_DM_GROUP_X; + x = LIB9P_DM_GROUP_X; #endif #ifdef LIB9P_DM_OTHER_R - x = LIB9P_DM_OTHER_R; + x = LIB9P_DM_OTHER_R; #endif #ifdef LIB9P_DM_OTHER_W - x = LIB9P_DM_OTHER_W; + x = LIB9P_DM_OTHER_W; #endif #ifdef LIB9P_DM_OTHER_X - x = LIB9P_DM_OTHER_X; + x = LIB9P_DM_OTHER_X; #endif #ifdef LIB9P_DM_OWNER_R - x = LIB9P_DM_OWNER_R; + x = LIB9P_DM_OWNER_R; #endif #ifdef LIB9P_DM_OWNER_W - x = LIB9P_DM_OWNER_W; + x = LIB9P_DM_OWNER_W; #endif #ifdef LIB9P_DM_OWNER_X - x = LIB9P_DM_OWNER_X; + x = LIB9P_DM_OWNER_X; #endif #ifdef LIB9P_DM_PERM_MASK - x = LIB9P_DM_PERM_MASK; + x = LIB9P_DM_PERM_MASK; #endif #ifdef LIB9P_DM_PIPE - x = LIB9P_DM_PIPE; + x = LIB9P_DM_PIPE; #endif #ifdef LIB9P_DM_SETGID - x = LIB9P_DM_SETGID; + x = LIB9P_DM_SETGID; #endif #ifdef LIB9P_DM_SETUID - x = LIB9P_DM_SETUID; + x = LIB9P_DM_SETUID; #endif #ifdef LIB9P_DM_SOCKET - x = LIB9P_DM_SOCKET; + x = LIB9P_DM_SOCKET; #endif #ifdef LIB9P_DM_TMP - x = LIB9P_DM_TMP; + x = LIB9P_DM_TMP; #endif #ifdef LIB9P_DT_BLOCK_DEV - x = LIB9P_DT_BLOCK_DEV; + x = LIB9P_DT_BLOCK_DEV; #endif #ifdef LIB9P_DT_CHAR_DEV - x = LIB9P_DT_CHAR_DEV; + x = LIB9P_DT_CHAR_DEV; #endif #ifdef LIB9P_DT_DIRECTORY - x = LIB9P_DT_DIRECTORY; + x = LIB9P_DT_DIRECTORY; #endif #ifdef LIB9P_DT_PIPE - x = LIB9P_DT_PIPE; + x = LIB9P_DT_PIPE; #endif #ifdef LIB9P_DT_REGULAR - x = LIB9P_DT_REGULAR; + x = LIB9P_DT_REGULAR; #endif #ifdef LIB9P_DT_SOCKET - x = LIB9P_DT_SOCKET; + x = LIB9P_DT_SOCKET; #endif #ifdef LIB9P_DT_SYMLINK - x = LIB9P_DT_SYMLINK; + x = LIB9P_DT_SYMLINK; #endif #ifdef LIB9P_DT_UNKNOWN - x = LIB9P_DT_UNKNOWN; + x = LIB9P_DT_UNKNOWN; #endif #ifdef LIB9P_ERRNO_L_E2BIG - x = LIB9P_ERRNO_L_E2BIG; + x = LIB9P_ERRNO_L_E2BIG; #endif #ifdef LIB9P_ERRNO_L_EACCES - x = LIB9P_ERRNO_L_EACCES; + x = LIB9P_ERRNO_L_EACCES; #endif #ifdef LIB9P_ERRNO_L_EADDRINUSE - x = LIB9P_ERRNO_L_EADDRINUSE; + x = LIB9P_ERRNO_L_EADDRINUSE; #endif #ifdef LIB9P_ERRNO_L_EADDRNOTAVAIL - x = LIB9P_ERRNO_L_EADDRNOTAVAIL; + x = LIB9P_ERRNO_L_EADDRNOTAVAIL; #endif #ifdef LIB9P_ERRNO_L_EADV - x = LIB9P_ERRNO_L_EADV; + x = LIB9P_ERRNO_L_EADV; #endif #ifdef LIB9P_ERRNO_L_EAFNOSUPPORT - x = LIB9P_ERRNO_L_EAFNOSUPPORT; + x = LIB9P_ERRNO_L_EAFNOSUPPORT; #endif #ifdef LIB9P_ERRNO_L_EAGAIN - x = LIB9P_ERRNO_L_EAGAIN; + x = LIB9P_ERRNO_L_EAGAIN; #endif #ifdef LIB9P_ERRNO_L_EALREADY - x = LIB9P_ERRNO_L_EALREADY; + x = LIB9P_ERRNO_L_EALREADY; #endif #ifdef LIB9P_ERRNO_L_EBADE - x = LIB9P_ERRNO_L_EBADE; + x = LIB9P_ERRNO_L_EBADE; #endif #ifdef LIB9P_ERRNO_L_EBADF - x = LIB9P_ERRNO_L_EBADF; + x = LIB9P_ERRNO_L_EBADF; #endif #ifdef LIB9P_ERRNO_L_EBADFD - x = LIB9P_ERRNO_L_EBADFD; + x = LIB9P_ERRNO_L_EBADFD; #endif #ifdef LIB9P_ERRNO_L_EBADMSG - x = LIB9P_ERRNO_L_EBADMSG; + x = LIB9P_ERRNO_L_EBADMSG; #endif #ifdef LIB9P_ERRNO_L_EBADR - x = LIB9P_ERRNO_L_EBADR; + x = LIB9P_ERRNO_L_EBADR; #endif #ifdef LIB9P_ERRNO_L_EBADRQC - x = LIB9P_ERRNO_L_EBADRQC; + x = LIB9P_ERRNO_L_EBADRQC; #endif #ifdef LIB9P_ERRNO_L_EBADSLT - x = LIB9P_ERRNO_L_EBADSLT; + x = LIB9P_ERRNO_L_EBADSLT; #endif #ifdef LIB9P_ERRNO_L_EBFONT - x = LIB9P_ERRNO_L_EBFONT; + x = LIB9P_ERRNO_L_EBFONT; #endif #ifdef LIB9P_ERRNO_L_EBUSY - x = LIB9P_ERRNO_L_EBUSY; + x = LIB9P_ERRNO_L_EBUSY; #endif #ifdef LIB9P_ERRNO_L_ECANCELED - x = LIB9P_ERRNO_L_ECANCELED; + x = LIB9P_ERRNO_L_ECANCELED; #endif #ifdef LIB9P_ERRNO_L_ECHILD - x = LIB9P_ERRNO_L_ECHILD; + x = LIB9P_ERRNO_L_ECHILD; #endif #ifdef LIB9P_ERRNO_L_ECHRNG - x = LIB9P_ERRNO_L_ECHRNG; + x = LIB9P_ERRNO_L_ECHRNG; #endif #ifdef LIB9P_ERRNO_L_ECOMM - x = LIB9P_ERRNO_L_ECOMM; + x = LIB9P_ERRNO_L_ECOMM; #endif #ifdef LIB9P_ERRNO_L_ECONNABORTED - x = LIB9P_ERRNO_L_ECONNABORTED; + x = LIB9P_ERRNO_L_ECONNABORTED; #endif #ifdef LIB9P_ERRNO_L_ECONNREFUSED - x = LIB9P_ERRNO_L_ECONNREFUSED; + x = LIB9P_ERRNO_L_ECONNREFUSED; #endif #ifdef LIB9P_ERRNO_L_ECONNRESET - x = LIB9P_ERRNO_L_ECONNRESET; + x = LIB9P_ERRNO_L_ECONNRESET; #endif #ifdef LIB9P_ERRNO_L_EDEADLK - x = LIB9P_ERRNO_L_EDEADLK; + x = LIB9P_ERRNO_L_EDEADLK; #endif #ifdef LIB9P_ERRNO_L_EDESTADDRREQ - x = LIB9P_ERRNO_L_EDESTADDRREQ; + x = LIB9P_ERRNO_L_EDESTADDRREQ; #endif #ifdef LIB9P_ERRNO_L_EDOM - x = LIB9P_ERRNO_L_EDOM; + x = LIB9P_ERRNO_L_EDOM; #endif #ifdef LIB9P_ERRNO_L_EDOTDOT - x = LIB9P_ERRNO_L_EDOTDOT; + x = LIB9P_ERRNO_L_EDOTDOT; #endif #ifdef LIB9P_ERRNO_L_EDQUOT - x = LIB9P_ERRNO_L_EDQUOT; + x = LIB9P_ERRNO_L_EDQUOT; #endif #ifdef LIB9P_ERRNO_L_EEXIST - x = LIB9P_ERRNO_L_EEXIST; + x = LIB9P_ERRNO_L_EEXIST; #endif #ifdef LIB9P_ERRNO_L_EFAULT - x = LIB9P_ERRNO_L_EFAULT; + x = LIB9P_ERRNO_L_EFAULT; #endif #ifdef LIB9P_ERRNO_L_EFBIG - x = LIB9P_ERRNO_L_EFBIG; + x = LIB9P_ERRNO_L_EFBIG; #endif #ifdef LIB9P_ERRNO_L_EHOSTDOWN - x = LIB9P_ERRNO_L_EHOSTDOWN; + x = LIB9P_ERRNO_L_EHOSTDOWN; #endif #ifdef LIB9P_ERRNO_L_EHOSTUNREACH - x = LIB9P_ERRNO_L_EHOSTUNREACH; + x = LIB9P_ERRNO_L_EHOSTUNREACH; #endif #ifdef LIB9P_ERRNO_L_EHWPOISON - x = LIB9P_ERRNO_L_EHWPOISON; + x = LIB9P_ERRNO_L_EHWPOISON; #endif #ifdef LIB9P_ERRNO_L_EIDRM - x = LIB9P_ERRNO_L_EIDRM; + x = LIB9P_ERRNO_L_EIDRM; #endif #ifdef LIB9P_ERRNO_L_EILSEQ - x = LIB9P_ERRNO_L_EILSEQ; + x = LIB9P_ERRNO_L_EILSEQ; #endif #ifdef LIB9P_ERRNO_L_EINPROGRESS - x = LIB9P_ERRNO_L_EINPROGRESS; + x = LIB9P_ERRNO_L_EINPROGRESS; #endif #ifdef LIB9P_ERRNO_L_EINTR - x = LIB9P_ERRNO_L_EINTR; + x = LIB9P_ERRNO_L_EINTR; #endif #ifdef LIB9P_ERRNO_L_EINVAL - x = LIB9P_ERRNO_L_EINVAL; + x = LIB9P_ERRNO_L_EINVAL; #endif #ifdef LIB9P_ERRNO_L_EIO - x = LIB9P_ERRNO_L_EIO; + x = LIB9P_ERRNO_L_EIO; #endif #ifdef LIB9P_ERRNO_L_EISCONN - x = LIB9P_ERRNO_L_EISCONN; + x = LIB9P_ERRNO_L_EISCONN; #endif #ifdef LIB9P_ERRNO_L_EISDIR - x = LIB9P_ERRNO_L_EISDIR; + x = LIB9P_ERRNO_L_EISDIR; #endif #ifdef LIB9P_ERRNO_L_EISNAM - x = LIB9P_ERRNO_L_EISNAM; + x = LIB9P_ERRNO_L_EISNAM; #endif #ifdef LIB9P_ERRNO_L_EKEYEXPIRED - x = LIB9P_ERRNO_L_EKEYEXPIRED; + x = LIB9P_ERRNO_L_EKEYEXPIRED; #endif #ifdef LIB9P_ERRNO_L_EKEYREJECTED - x = LIB9P_ERRNO_L_EKEYREJECTED; + x = LIB9P_ERRNO_L_EKEYREJECTED; #endif #ifdef LIB9P_ERRNO_L_EKEYREVOKED - x = LIB9P_ERRNO_L_EKEYREVOKED; + x = LIB9P_ERRNO_L_EKEYREVOKED; #endif #ifdef LIB9P_ERRNO_L_EL2HLT - x = LIB9P_ERRNO_L_EL2HLT; + x = LIB9P_ERRNO_L_EL2HLT; #endif #ifdef LIB9P_ERRNO_L_EL2NSYNC - x = LIB9P_ERRNO_L_EL2NSYNC; + x = LIB9P_ERRNO_L_EL2NSYNC; #endif #ifdef LIB9P_ERRNO_L_EL3HLT - x = LIB9P_ERRNO_L_EL3HLT; + x = LIB9P_ERRNO_L_EL3HLT; #endif #ifdef LIB9P_ERRNO_L_EL3RST - x = LIB9P_ERRNO_L_EL3RST; + x = LIB9P_ERRNO_L_EL3RST; #endif #ifdef LIB9P_ERRNO_L_ELIBACC - x = LIB9P_ERRNO_L_ELIBACC; + x = LIB9P_ERRNO_L_ELIBACC; #endif #ifdef LIB9P_ERRNO_L_ELIBBAD - x = LIB9P_ERRNO_L_ELIBBAD; + x = LIB9P_ERRNO_L_ELIBBAD; #endif #ifdef LIB9P_ERRNO_L_ELIBEXEC - x = LIB9P_ERRNO_L_ELIBEXEC; + x = LIB9P_ERRNO_L_ELIBEXEC; #endif #ifdef LIB9P_ERRNO_L_ELIBMAX - x = LIB9P_ERRNO_L_ELIBMAX; + x = LIB9P_ERRNO_L_ELIBMAX; #endif #ifdef LIB9P_ERRNO_L_ELIBSCN - x = LIB9P_ERRNO_L_ELIBSCN; + x = LIB9P_ERRNO_L_ELIBSCN; #endif #ifdef LIB9P_ERRNO_L_ELNRNG - x = LIB9P_ERRNO_L_ELNRNG; + x = LIB9P_ERRNO_L_ELNRNG; #endif #ifdef LIB9P_ERRNO_L_ELOOP - x = LIB9P_ERRNO_L_ELOOP; + x = LIB9P_ERRNO_L_ELOOP; #endif #ifdef LIB9P_ERRNO_L_EMEDIUMTYPE - x = LIB9P_ERRNO_L_EMEDIUMTYPE; + x = LIB9P_ERRNO_L_EMEDIUMTYPE; #endif #ifdef LIB9P_ERRNO_L_EMFILE - x = LIB9P_ERRNO_L_EMFILE; + x = LIB9P_ERRNO_L_EMFILE; #endif #ifdef LIB9P_ERRNO_L_EMLINK - x = LIB9P_ERRNO_L_EMLINK; + x = LIB9P_ERRNO_L_EMLINK; #endif #ifdef LIB9P_ERRNO_L_EMSGSIZE - x = LIB9P_ERRNO_L_EMSGSIZE; + x = LIB9P_ERRNO_L_EMSGSIZE; #endif #ifdef LIB9P_ERRNO_L_EMULTIHOP - x = LIB9P_ERRNO_L_EMULTIHOP; + x = LIB9P_ERRNO_L_EMULTIHOP; #endif #ifdef LIB9P_ERRNO_L_ENAMETOOLONG - x = LIB9P_ERRNO_L_ENAMETOOLONG; + x = LIB9P_ERRNO_L_ENAMETOOLONG; #endif #ifdef LIB9P_ERRNO_L_ENAVAIL - x = LIB9P_ERRNO_L_ENAVAIL; + x = LIB9P_ERRNO_L_ENAVAIL; #endif #ifdef LIB9P_ERRNO_L_ENETDOWN - x = LIB9P_ERRNO_L_ENETDOWN; + x = LIB9P_ERRNO_L_ENETDOWN; #endif #ifdef LIB9P_ERRNO_L_ENETRESET - x = LIB9P_ERRNO_L_ENETRESET; + x = LIB9P_ERRNO_L_ENETRESET; #endif #ifdef LIB9P_ERRNO_L_ENETUNREACH - x = LIB9P_ERRNO_L_ENETUNREACH; + x = LIB9P_ERRNO_L_ENETUNREACH; #endif #ifdef LIB9P_ERRNO_L_ENFILE - x = LIB9P_ERRNO_L_ENFILE; + x = LIB9P_ERRNO_L_ENFILE; #endif #ifdef LIB9P_ERRNO_L_ENOANO - x = LIB9P_ERRNO_L_ENOANO; + x = LIB9P_ERRNO_L_ENOANO; #endif #ifdef LIB9P_ERRNO_L_ENOBUFS - x = LIB9P_ERRNO_L_ENOBUFS; + x = LIB9P_ERRNO_L_ENOBUFS; #endif #ifdef LIB9P_ERRNO_L_ENOCSI - x = LIB9P_ERRNO_L_ENOCSI; + x = LIB9P_ERRNO_L_ENOCSI; #endif #ifdef LIB9P_ERRNO_L_ENODATA - x = LIB9P_ERRNO_L_ENODATA; + x = LIB9P_ERRNO_L_ENODATA; #endif #ifdef LIB9P_ERRNO_L_ENODEV - x = LIB9P_ERRNO_L_ENODEV; + x = LIB9P_ERRNO_L_ENODEV; #endif #ifdef LIB9P_ERRNO_L_ENOENT - x = LIB9P_ERRNO_L_ENOENT; + x = LIB9P_ERRNO_L_ENOENT; #endif #ifdef LIB9P_ERRNO_L_ENOEXEC - x = LIB9P_ERRNO_L_ENOEXEC; + x = LIB9P_ERRNO_L_ENOEXEC; #endif #ifdef LIB9P_ERRNO_L_ENOKEY - x = LIB9P_ERRNO_L_ENOKEY; + x = LIB9P_ERRNO_L_ENOKEY; #endif #ifdef LIB9P_ERRNO_L_ENOLCK - x = LIB9P_ERRNO_L_ENOLCK; + x = LIB9P_ERRNO_L_ENOLCK; #endif #ifdef LIB9P_ERRNO_L_ENOLINK - x = LIB9P_ERRNO_L_ENOLINK; + x = LIB9P_ERRNO_L_ENOLINK; #endif #ifdef LIB9P_ERRNO_L_ENOMEDIUM - x = LIB9P_ERRNO_L_ENOMEDIUM; + x = LIB9P_ERRNO_L_ENOMEDIUM; #endif #ifdef LIB9P_ERRNO_L_ENOMEM - x = LIB9P_ERRNO_L_ENOMEM; + x = LIB9P_ERRNO_L_ENOMEM; #endif #ifdef LIB9P_ERRNO_L_ENOMSG - x = LIB9P_ERRNO_L_ENOMSG; + x = LIB9P_ERRNO_L_ENOMSG; #endif #ifdef LIB9P_ERRNO_L_ENONET - x = LIB9P_ERRNO_L_ENONET; + x = LIB9P_ERRNO_L_ENONET; #endif #ifdef LIB9P_ERRNO_L_ENOPKG - x = LIB9P_ERRNO_L_ENOPKG; + x = LIB9P_ERRNO_L_ENOPKG; #endif #ifdef LIB9P_ERRNO_L_ENOPROTOOPT - x = LIB9P_ERRNO_L_ENOPROTOOPT; + x = LIB9P_ERRNO_L_ENOPROTOOPT; #endif #ifdef LIB9P_ERRNO_L_ENOSPC - x = LIB9P_ERRNO_L_ENOSPC; + x = LIB9P_ERRNO_L_ENOSPC; #endif #ifdef LIB9P_ERRNO_L_ENOSR - x = LIB9P_ERRNO_L_ENOSR; + x = LIB9P_ERRNO_L_ENOSR; #endif #ifdef LIB9P_ERRNO_L_ENOSTR - x = LIB9P_ERRNO_L_ENOSTR; + x = LIB9P_ERRNO_L_ENOSTR; #endif #ifdef LIB9P_ERRNO_L_ENOSYS - x = LIB9P_ERRNO_L_ENOSYS; + x = LIB9P_ERRNO_L_ENOSYS; #endif #ifdef LIB9P_ERRNO_L_ENOTBLK - x = LIB9P_ERRNO_L_ENOTBLK; + x = LIB9P_ERRNO_L_ENOTBLK; #endif #ifdef LIB9P_ERRNO_L_ENOTCONN - x = LIB9P_ERRNO_L_ENOTCONN; + x = LIB9P_ERRNO_L_ENOTCONN; #endif #ifdef LIB9P_ERRNO_L_ENOTDIR - x = LIB9P_ERRNO_L_ENOTDIR; + x = LIB9P_ERRNO_L_ENOTDIR; #endif #ifdef LIB9P_ERRNO_L_ENOTEMPTY - x = LIB9P_ERRNO_L_ENOTEMPTY; + x = LIB9P_ERRNO_L_ENOTEMPTY; #endif #ifdef LIB9P_ERRNO_L_ENOTNAM - x = LIB9P_ERRNO_L_ENOTNAM; + x = LIB9P_ERRNO_L_ENOTNAM; #endif #ifdef LIB9P_ERRNO_L_ENOTRECOVERABLE - x = LIB9P_ERRNO_L_ENOTRECOVERABLE; + x = LIB9P_ERRNO_L_ENOTRECOVERABLE; #endif #ifdef LIB9P_ERRNO_L_ENOTSOCK - x = LIB9P_ERRNO_L_ENOTSOCK; + x = LIB9P_ERRNO_L_ENOTSOCK; #endif #ifdef LIB9P_ERRNO_L_ENOTTY - x = LIB9P_ERRNO_L_ENOTTY; + x = LIB9P_ERRNO_L_ENOTTY; #endif #ifdef LIB9P_ERRNO_L_ENOTUNIQ - x = LIB9P_ERRNO_L_ENOTUNIQ; + x = LIB9P_ERRNO_L_ENOTUNIQ; #endif #ifdef LIB9P_ERRNO_L_ENXIO - x = LIB9P_ERRNO_L_ENXIO; + x = LIB9P_ERRNO_L_ENXIO; #endif #ifdef LIB9P_ERRNO_L_EOPNOTSUPP - x = LIB9P_ERRNO_L_EOPNOTSUPP; + x = LIB9P_ERRNO_L_EOPNOTSUPP; #endif #ifdef LIB9P_ERRNO_L_EOVERFLOW - x = LIB9P_ERRNO_L_EOVERFLOW; + x = LIB9P_ERRNO_L_EOVERFLOW; #endif #ifdef LIB9P_ERRNO_L_EOWNERDEAD - x = LIB9P_ERRNO_L_EOWNERDEAD; + x = LIB9P_ERRNO_L_EOWNERDEAD; #endif #ifdef LIB9P_ERRNO_L_EPERM - x = LIB9P_ERRNO_L_EPERM; + x = LIB9P_ERRNO_L_EPERM; #endif #ifdef LIB9P_ERRNO_L_EPFNOSUPPORT - x = LIB9P_ERRNO_L_EPFNOSUPPORT; + x = LIB9P_ERRNO_L_EPFNOSUPPORT; #endif #ifdef LIB9P_ERRNO_L_EPIPE - x = LIB9P_ERRNO_L_EPIPE; + x = LIB9P_ERRNO_L_EPIPE; #endif #ifdef LIB9P_ERRNO_L_EPROTO - x = LIB9P_ERRNO_L_EPROTO; + x = LIB9P_ERRNO_L_EPROTO; #endif #ifdef LIB9P_ERRNO_L_EPROTONOSUPPORT - x = LIB9P_ERRNO_L_EPROTONOSUPPORT; + x = LIB9P_ERRNO_L_EPROTONOSUPPORT; #endif #ifdef LIB9P_ERRNO_L_EPROTOTYPE - x = LIB9P_ERRNO_L_EPROTOTYPE; + x = LIB9P_ERRNO_L_EPROTOTYPE; #endif #ifdef LIB9P_ERRNO_L_ERANGE - x = LIB9P_ERRNO_L_ERANGE; + x = LIB9P_ERRNO_L_ERANGE; #endif #ifdef LIB9P_ERRNO_L_EREMCHG - x = LIB9P_ERRNO_L_EREMCHG; + x = LIB9P_ERRNO_L_EREMCHG; #endif #ifdef LIB9P_ERRNO_L_EREMOTE - x = LIB9P_ERRNO_L_EREMOTE; + x = LIB9P_ERRNO_L_EREMOTE; #endif #ifdef LIB9P_ERRNO_L_EREMOTEIO - x = LIB9P_ERRNO_L_EREMOTEIO; + x = LIB9P_ERRNO_L_EREMOTEIO; #endif #ifdef LIB9P_ERRNO_L_ERESTART - x = LIB9P_ERRNO_L_ERESTART; + x = LIB9P_ERRNO_L_ERESTART; #endif #ifdef LIB9P_ERRNO_L_ERFKILL - x = LIB9P_ERRNO_L_ERFKILL; + x = LIB9P_ERRNO_L_ERFKILL; #endif #ifdef LIB9P_ERRNO_L_EROFS - x = LIB9P_ERRNO_L_EROFS; + x = LIB9P_ERRNO_L_EROFS; #endif #ifdef LIB9P_ERRNO_L_ESHUTDOWN - x = LIB9P_ERRNO_L_ESHUTDOWN; + x = LIB9P_ERRNO_L_ESHUTDOWN; #endif #ifdef LIB9P_ERRNO_L_ESOCKTNOSUPPORT - x = LIB9P_ERRNO_L_ESOCKTNOSUPPORT; + x = LIB9P_ERRNO_L_ESOCKTNOSUPPORT; #endif #ifdef LIB9P_ERRNO_L_ESPIPE - x = LIB9P_ERRNO_L_ESPIPE; + x = LIB9P_ERRNO_L_ESPIPE; #endif #ifdef LIB9P_ERRNO_L_ESRCH - x = LIB9P_ERRNO_L_ESRCH; + x = LIB9P_ERRNO_L_ESRCH; #endif #ifdef LIB9P_ERRNO_L_ESRMNT - x = LIB9P_ERRNO_L_ESRMNT; + x = LIB9P_ERRNO_L_ESRMNT; #endif #ifdef LIB9P_ERRNO_L_ESTALE - x = LIB9P_ERRNO_L_ESTALE; + x = LIB9P_ERRNO_L_ESTALE; #endif #ifdef LIB9P_ERRNO_L_ESTRPIPE - x = LIB9P_ERRNO_L_ESTRPIPE; + x = LIB9P_ERRNO_L_ESTRPIPE; #endif #ifdef LIB9P_ERRNO_L_ETIME - x = LIB9P_ERRNO_L_ETIME; + x = LIB9P_ERRNO_L_ETIME; #endif #ifdef LIB9P_ERRNO_L_ETIMEDOUT - x = LIB9P_ERRNO_L_ETIMEDOUT; + x = LIB9P_ERRNO_L_ETIMEDOUT; #endif #ifdef LIB9P_ERRNO_L_ETOOMANYREFS - x = LIB9P_ERRNO_L_ETOOMANYREFS; + x = LIB9P_ERRNO_L_ETOOMANYREFS; #endif #ifdef LIB9P_ERRNO_L_ETXTBSY - x = LIB9P_ERRNO_L_ETXTBSY; + x = LIB9P_ERRNO_L_ETXTBSY; #endif #ifdef LIB9P_ERRNO_L_EUCLEAN - x = LIB9P_ERRNO_L_EUCLEAN; + x = LIB9P_ERRNO_L_EUCLEAN; #endif #ifdef LIB9P_ERRNO_L_EUNATCH - x = LIB9P_ERRNO_L_EUNATCH; + x = LIB9P_ERRNO_L_EUNATCH; #endif #ifdef LIB9P_ERRNO_L_EUSERS - x = LIB9P_ERRNO_L_EUSERS; + x = LIB9P_ERRNO_L_EUSERS; #endif #ifdef LIB9P_ERRNO_L_EXDEV - x = LIB9P_ERRNO_L_EXDEV; + x = LIB9P_ERRNO_L_EXDEV; #endif #ifdef LIB9P_ERRNO_L_EXFULL - x = LIB9P_ERRNO_L_EXFULL; + x = LIB9P_ERRNO_L_EXFULL; #endif #ifdef LIB9P_ERRNO_NOERROR - x = LIB9P_ERRNO_NOERROR; + x = LIB9P_ERRNO_NOERROR; #endif #ifdef LIB9P_FID_NOFID - x = LIB9P_FID_NOFID; + x = LIB9P_FID_NOFID; #endif #ifdef LIB9P_GETATTR_ALL - x = LIB9P_GETATTR_ALL; + x = LIB9P_GETATTR_ALL; #endif #ifdef LIB9P_GETATTR_ATIME - x = LIB9P_GETATTR_ATIME; + x = LIB9P_GETATTR_ATIME; #endif #ifdef LIB9P_GETATTR_BASIC - x = LIB9P_GETATTR_BASIC; + x = LIB9P_GETATTR_BASIC; #endif #ifdef LIB9P_GETATTR_BLOCKS - x = LIB9P_GETATTR_BLOCKS; + x = LIB9P_GETATTR_BLOCKS; #endif #ifdef LIB9P_GETATTR_BTIME - x = LIB9P_GETATTR_BTIME; + x = LIB9P_GETATTR_BTIME; #endif #ifdef LIB9P_GETATTR_CTIME - x = LIB9P_GETATTR_CTIME; + x = LIB9P_GETATTR_CTIME; #endif #ifdef LIB9P_GETATTR_DATA_VERSION - x = LIB9P_GETATTR_DATA_VERSION; + x = LIB9P_GETATTR_DATA_VERSION; #endif #ifdef LIB9P_GETATTR_GEN - x = LIB9P_GETATTR_GEN; + x = LIB9P_GETATTR_GEN; #endif #ifdef LIB9P_GETATTR_GID - x = LIB9P_GETATTR_GID; + x = LIB9P_GETATTR_GID; #endif #ifdef LIB9P_GETATTR_INO - x = LIB9P_GETATTR_INO; + x = LIB9P_GETATTR_INO; #endif #ifdef LIB9P_GETATTR_MODE - x = LIB9P_GETATTR_MODE; + x = LIB9P_GETATTR_MODE; #endif #ifdef LIB9P_GETATTR_MTIME - x = LIB9P_GETATTR_MTIME; + x = LIB9P_GETATTR_MTIME; #endif #ifdef LIB9P_GETATTR_NLINK - x = LIB9P_GETATTR_NLINK; + x = LIB9P_GETATTR_NLINK; #endif #ifdef LIB9P_GETATTR_RDEV - x = LIB9P_GETATTR_RDEV; + x = LIB9P_GETATTR_RDEV; #endif #ifdef LIB9P_GETATTR_SIZE - x = LIB9P_GETATTR_SIZE; + x = LIB9P_GETATTR_SIZE; #endif #ifdef LIB9P_GETATTR_UID - x = LIB9P_GETATTR_UID; + x = LIB9P_GETATTR_UID; #endif #ifdef LIB9P_LOCK_FLAGS_BLOCK - x = LIB9P_LOCK_FLAGS_BLOCK; + x = LIB9P_LOCK_FLAGS_BLOCK; #endif #ifdef LIB9P_LOCK_FLAGS_RECLAIM - x = LIB9P_LOCK_FLAGS_RECLAIM; + x = LIB9P_LOCK_FLAGS_RECLAIM; #endif #ifdef LIB9P_LOCK_STATUS_BLOCKED - x = LIB9P_LOCK_STATUS_BLOCKED; + x = LIB9P_LOCK_STATUS_BLOCKED; #endif #ifdef LIB9P_LOCK_STATUS_ERROR - x = LIB9P_LOCK_STATUS_ERROR; + x = LIB9P_LOCK_STATUS_ERROR; #endif #ifdef LIB9P_LOCK_STATUS_GRACE - x = LIB9P_LOCK_STATUS_GRACE; + x = LIB9P_LOCK_STATUS_GRACE; #endif #ifdef LIB9P_LOCK_STATUS_SUCCESS - x = LIB9P_LOCK_STATUS_SUCCESS; + x = LIB9P_LOCK_STATUS_SUCCESS; #endif #ifdef LIB9P_LOCK_TYPE_RDLCK - x = LIB9P_LOCK_TYPE_RDLCK; + x = LIB9P_LOCK_TYPE_RDLCK; #endif #ifdef LIB9P_LOCK_TYPE_UNLCK - x = LIB9P_LOCK_TYPE_UNLCK; + x = LIB9P_LOCK_TYPE_UNLCK; #endif #ifdef LIB9P_LOCK_TYPE_WRLCK - x = LIB9P_LOCK_TYPE_WRLCK; + x = LIB9P_LOCK_TYPE_WRLCK; #endif #ifdef LIB9P_LO_APPEND - x = LIB9P_LO_APPEND; + x = LIB9P_LO_APPEND; #endif #ifdef LIB9P_LO_BSD_FASYNC - x = LIB9P_LO_BSD_FASYNC; + x = LIB9P_LO_BSD_FASYNC; #endif #ifdef LIB9P_LO_CLOEXEC - x = LIB9P_LO_CLOEXEC; + x = LIB9P_LO_CLOEXEC; #endif #ifdef LIB9P_LO_CREATE - x = LIB9P_LO_CREATE; + x = LIB9P_LO_CREATE; #endif #ifdef LIB9P_LO_DIRECT - x = LIB9P_LO_DIRECT; + x = LIB9P_LO_DIRECT; #endif #ifdef LIB9P_LO_DIRECTORY - x = LIB9P_LO_DIRECTORY; + x = LIB9P_LO_DIRECTORY; #endif #ifdef LIB9P_LO_DSYNC - x = LIB9P_LO_DSYNC; + x = LIB9P_LO_DSYNC; #endif #ifdef LIB9P_LO_EXCL - x = LIB9P_LO_EXCL; + x = LIB9P_LO_EXCL; #endif #ifdef LIB9P_LO_FLAG_MASK - x = LIB9P_LO_FLAG_MASK; + x = LIB9P_LO_FLAG_MASK; #endif #ifdef LIB9P_LO_LARGEFILE - x = LIB9P_LO_LARGEFILE; + x = LIB9P_LO_LARGEFILE; #endif #ifdef LIB9P_LO_MODE_MASK - x = LIB9P_LO_MODE_MASK; + x = LIB9P_LO_MODE_MASK; #endif #ifdef LIB9P_LO_MODE_NOACCESS - x = LIB9P_LO_MODE_NOACCESS; + x = LIB9P_LO_MODE_NOACCESS; #endif #ifdef LIB9P_LO_MODE_RDONLY - x = LIB9P_LO_MODE_RDONLY; + x = LIB9P_LO_MODE_RDONLY; #endif #ifdef LIB9P_LO_MODE_RDWR - x = LIB9P_LO_MODE_RDWR; + x = LIB9P_LO_MODE_RDWR; #endif #ifdef LIB9P_LO_MODE_WRONLY - x = LIB9P_LO_MODE_WRONLY; + x = LIB9P_LO_MODE_WRONLY; #endif #ifdef LIB9P_LO_NOATIME - x = LIB9P_LO_NOATIME; + x = LIB9P_LO_NOATIME; #endif #ifdef LIB9P_LO_NOCTTY - x = LIB9P_LO_NOCTTY; + x = LIB9P_LO_NOCTTY; #endif #ifdef LIB9P_LO_NOFOLLOW - x = LIB9P_LO_NOFOLLOW; + x = LIB9P_LO_NOFOLLOW; #endif #ifdef LIB9P_LO_NONBLOCK - x = LIB9P_LO_NONBLOCK; + x = LIB9P_LO_NONBLOCK; #endif #ifdef LIB9P_LO_SYNC - x = LIB9P_LO_SYNC; + x = LIB9P_LO_SYNC; #endif #ifdef LIB9P_LO_TRUNC - x = LIB9P_LO_TRUNC; + x = LIB9P_LO_TRUNC; #endif #ifdef LIB9P_MODE_FMT_BLOCK_DEV - x = LIB9P_MODE_FMT_BLOCK_DEV; + x = LIB9P_MODE_FMT_BLOCK_DEV; #endif #ifdef LIB9P_MODE_FMT_CHAR_DEV - x = LIB9P_MODE_FMT_CHAR_DEV; + x = LIB9P_MODE_FMT_CHAR_DEV; #endif #ifdef LIB9P_MODE_FMT_DIRECTORY - x = LIB9P_MODE_FMT_DIRECTORY; + x = LIB9P_MODE_FMT_DIRECTORY; #endif #ifdef LIB9P_MODE_FMT_MASK - x = LIB9P_MODE_FMT_MASK; + x = LIB9P_MODE_FMT_MASK; #endif #ifdef LIB9P_MODE_FMT_PIPE - x = LIB9P_MODE_FMT_PIPE; + x = LIB9P_MODE_FMT_PIPE; #endif #ifdef LIB9P_MODE_FMT_REGULAR - x = LIB9P_MODE_FMT_REGULAR; + x = LIB9P_MODE_FMT_REGULAR; #endif #ifdef LIB9P_MODE_FMT_SOCKET - x = LIB9P_MODE_FMT_SOCKET; + x = LIB9P_MODE_FMT_SOCKET; #endif #ifdef LIB9P_MODE_FMT_SYMLINK - x = LIB9P_MODE_FMT_SYMLINK; + x = LIB9P_MODE_FMT_SYMLINK; #endif #ifdef LIB9P_MODE_PERM_GROUP_R - x = LIB9P_MODE_PERM_GROUP_R; + x = LIB9P_MODE_PERM_GROUP_R; #endif #ifdef LIB9P_MODE_PERM_GROUP_W - x = LIB9P_MODE_PERM_GROUP_W; + x = LIB9P_MODE_PERM_GROUP_W; #endif #ifdef LIB9P_MODE_PERM_GROUP_X - x = LIB9P_MODE_PERM_GROUP_X; + x = LIB9P_MODE_PERM_GROUP_X; #endif #ifdef LIB9P_MODE_PERM_MASK - x = LIB9P_MODE_PERM_MASK; + x = LIB9P_MODE_PERM_MASK; #endif #ifdef LIB9P_MODE_PERM_OTHER_R - x = LIB9P_MODE_PERM_OTHER_R; + x = LIB9P_MODE_PERM_OTHER_R; #endif #ifdef LIB9P_MODE_PERM_OTHER_W - x = LIB9P_MODE_PERM_OTHER_W; + x = LIB9P_MODE_PERM_OTHER_W; #endif #ifdef LIB9P_MODE_PERM_OTHER_X - x = LIB9P_MODE_PERM_OTHER_X; + x = LIB9P_MODE_PERM_OTHER_X; #endif #ifdef LIB9P_MODE_PERM_OWNER_R - x = LIB9P_MODE_PERM_OWNER_R; + x = LIB9P_MODE_PERM_OWNER_R; #endif #ifdef LIB9P_MODE_PERM_OWNER_W - x = LIB9P_MODE_PERM_OWNER_W; + x = LIB9P_MODE_PERM_OWNER_W; #endif #ifdef LIB9P_MODE_PERM_OWNER_X - x = LIB9P_MODE_PERM_OWNER_X; + x = LIB9P_MODE_PERM_OWNER_X; #endif #ifdef LIB9P_MODE_PERM_SETGROUP - x = LIB9P_MODE_PERM_SETGROUP; + x = LIB9P_MODE_PERM_SETGROUP; #endif #ifdef LIB9P_MODE_PERM_SETUSER - x = LIB9P_MODE_PERM_SETUSER; + x = LIB9P_MODE_PERM_SETUSER; #endif #ifdef LIB9P_MODE_PERM_STICKY - x = LIB9P_MODE_PERM_STICKY; + x = LIB9P_MODE_PERM_STICKY; #endif #ifdef LIB9P_NUID_NONUID - x = LIB9P_NUID_NONUID; + x = LIB9P_NUID_NONUID; #endif #ifdef LIB9P_O_FLAG_MASK - x = LIB9P_O_FLAG_MASK; + x = LIB9P_O_FLAG_MASK; #endif #ifdef LIB9P_O_MODE_EXEC - x = LIB9P_O_MODE_EXEC; + x = LIB9P_O_MODE_EXEC; #endif #ifdef LIB9P_O_MODE_MASK - x = LIB9P_O_MODE_MASK; + x = LIB9P_O_MODE_MASK; #endif #ifdef LIB9P_O_MODE_RDWR - x = LIB9P_O_MODE_RDWR; + x = LIB9P_O_MODE_RDWR; #endif #ifdef LIB9P_O_MODE_READ - x = LIB9P_O_MODE_READ; + x = LIB9P_O_MODE_READ; #endif #ifdef LIB9P_O_MODE_WRITE - x = LIB9P_O_MODE_WRITE; + x = LIB9P_O_MODE_WRITE; #endif #ifdef LIB9P_O_RCLOSE - x = LIB9P_O_RCLOSE; + x = LIB9P_O_RCLOSE; #endif #ifdef LIB9P_O_TRUNC - x = LIB9P_O_TRUNC; + x = LIB9P_O_TRUNC; #endif #ifdef LIB9P_QT_APPEND - x = LIB9P_QT_APPEND; + x = LIB9P_QT_APPEND; #endif #ifdef LIB9P_QT_AUTH - x = LIB9P_QT_AUTH; + x = LIB9P_QT_AUTH; #endif #ifdef LIB9P_QT_DIR - x = LIB9P_QT_DIR; + x = LIB9P_QT_DIR; #endif #ifdef LIB9P_QT_EXCL - x = LIB9P_QT_EXCL; + x = LIB9P_QT_EXCL; #endif #ifdef LIB9P_QT_FILE - x = LIB9P_QT_FILE; + x = LIB9P_QT_FILE; #endif #ifdef LIB9P_QT_SYMLINK - x = LIB9P_QT_SYMLINK; + x = LIB9P_QT_SYMLINK; #endif #ifdef LIB9P_QT_TMP - x = LIB9P_QT_TMP; + x = LIB9P_QT_TMP; #endif #ifdef LIB9P_RMSG_MAX_COPY - x = LIB9P_RMSG_MAX_COPY; + x = LIB9P_RMSG_MAX_COPY; #endif #ifdef LIB9P_RMSG_MAX_IOV - x = LIB9P_RMSG_MAX_IOV; + x = LIB9P_RMSG_MAX_IOV; #endif #ifdef LIB9P_SETATTR_ATIME - x = LIB9P_SETATTR_ATIME; + x = LIB9P_SETATTR_ATIME; #endif #ifdef LIB9P_SETATTR_ATIME_SET - x = LIB9P_SETATTR_ATIME_SET; + x = LIB9P_SETATTR_ATIME_SET; #endif #ifdef LIB9P_SETATTR_CTIME - x = LIB9P_SETATTR_CTIME; + x = LIB9P_SETATTR_CTIME; #endif #ifdef LIB9P_SETATTR_GID - x = LIB9P_SETATTR_GID; + x = LIB9P_SETATTR_GID; #endif #ifdef LIB9P_SETATTR_MODE - x = LIB9P_SETATTR_MODE; + x = LIB9P_SETATTR_MODE; #endif #ifdef LIB9P_SETATTR_MTIME - x = LIB9P_SETATTR_MTIME; + x = LIB9P_SETATTR_MTIME; #endif #ifdef LIB9P_SETATTR_MTIME_SET - x = LIB9P_SETATTR_MTIME_SET; + x = LIB9P_SETATTR_MTIME_SET; #endif #ifdef LIB9P_SETATTR_SIZE - x = LIB9P_SETATTR_SIZE; + x = LIB9P_SETATTR_SIZE; #endif #ifdef LIB9P_SETATTR_UID - x = LIB9P_SETATTR_UID; + x = LIB9P_SETATTR_UID; #endif #ifdef LIB9P_SUPER_MAGIC_V9FS_MAGIC - x = LIB9P_SUPER_MAGIC_V9FS_MAGIC; + x = LIB9P_SUPER_MAGIC_V9FS_MAGIC; #endif #ifdef LIB9P_TAG_NOTAG - x = LIB9P_TAG_NOTAG; + x = LIB9P_TAG_NOTAG; #endif #ifdef LIB9P_TMSG_MAX_COPY - x = LIB9P_TMSG_MAX_COPY; + x = LIB9P_TMSG_MAX_COPY; #endif #ifdef LIB9P_TMSG_MAX_IOV - x = LIB9P_TMSG_MAX_IOV; + x = LIB9P_TMSG_MAX_IOV; #endif #ifdef _LIB9P_DM_PLAN9_MOUNT - x = _LIB9P_DM_PLAN9_MOUNT; + x = _LIB9P_DM_PLAN9_MOUNT; #endif #ifdef _LIB9P_DM_UNUSED_10 - x = _LIB9P_DM_UNUSED_10; + x = _LIB9P_DM_UNUSED_10; #endif #ifdef _LIB9P_DM_UNUSED_11 - x = _LIB9P_DM_UNUSED_11; + x = _LIB9P_DM_UNUSED_11; #endif #ifdef _LIB9P_DM_UNUSED_12 - x = _LIB9P_DM_UNUSED_12; + x = _LIB9P_DM_UNUSED_12; #endif #ifdef _LIB9P_DM_UNUSED_13 - x = _LIB9P_DM_UNUSED_13; + x = _LIB9P_DM_UNUSED_13; #endif #ifdef _LIB9P_DM_UNUSED_14 - x = _LIB9P_DM_UNUSED_14; + x = _LIB9P_DM_UNUSED_14; #endif #ifdef _LIB9P_DM_UNUSED_15 - x = _LIB9P_DM_UNUSED_15; + x = _LIB9P_DM_UNUSED_15; #endif #ifdef _LIB9P_DM_UNUSED_16 - x = _LIB9P_DM_UNUSED_16; + x = _LIB9P_DM_UNUSED_16; #endif #ifdef _LIB9P_DM_UNUSED_17 - x = _LIB9P_DM_UNUSED_17; + x = _LIB9P_DM_UNUSED_17; #endif #ifdef _LIB9P_DM_UNUSED_22 - x = _LIB9P_DM_UNUSED_22; + x = _LIB9P_DM_UNUSED_22; #endif #ifdef _LIB9P_DM_UNUSED_24 - x = _LIB9P_DM_UNUSED_24; + x = _LIB9P_DM_UNUSED_24; #endif #ifdef _LIB9P_DM_UNUSED_25 - x = _LIB9P_DM_UNUSED_25; + x = _LIB9P_DM_UNUSED_25; #endif #ifdef _LIB9P_DM_UNUSED_9 - x = _LIB9P_DM_UNUSED_9; + x = _LIB9P_DM_UNUSED_9; #endif #ifdef _LIB9P_DT_WHITEOUT - x = _LIB9P_DT_WHITEOUT; + x = _LIB9P_DT_WHITEOUT; #endif #ifdef _LIB9P_ENABLE_stat - x = _LIB9P_ENABLE_stat; + x = _LIB9P_ENABLE_stat; #endif #ifdef _LIB9P_GETATTR_UNUSED_14 - x = _LIB9P_GETATTR_UNUSED_14; + x = _LIB9P_GETATTR_UNUSED_14; #endif #ifdef _LIB9P_GETATTR_UNUSED_15 - x = _LIB9P_GETATTR_UNUSED_15; + x = _LIB9P_GETATTR_UNUSED_15; #endif #ifdef _LIB9P_GETATTR_UNUSED_16 - x = _LIB9P_GETATTR_UNUSED_16; + x = _LIB9P_GETATTR_UNUSED_16; #endif #ifdef _LIB9P_GETATTR_UNUSED_17 - x = _LIB9P_GETATTR_UNUSED_17; + x = _LIB9P_GETATTR_UNUSED_17; #endif #ifdef _LIB9P_GETATTR_UNUSED_18 - x = _LIB9P_GETATTR_UNUSED_18; + x = _LIB9P_GETATTR_UNUSED_18; #endif #ifdef _LIB9P_GETATTR_UNUSED_19 - x = _LIB9P_GETATTR_UNUSED_19; + x = _LIB9P_GETATTR_UNUSED_19; #endif #ifdef _LIB9P_GETATTR_UNUSED_20 - x = _LIB9P_GETATTR_UNUSED_20; + x = _LIB9P_GETATTR_UNUSED_20; #endif #ifdef _LIB9P_GETATTR_UNUSED_21 - x = _LIB9P_GETATTR_UNUSED_21; + x = _LIB9P_GETATTR_UNUSED_21; #endif #ifdef _LIB9P_GETATTR_UNUSED_22 - x = _LIB9P_GETATTR_UNUSED_22; + x = _LIB9P_GETATTR_UNUSED_22; #endif #ifdef _LIB9P_GETATTR_UNUSED_23 - x = _LIB9P_GETATTR_UNUSED_23; + x = _LIB9P_GETATTR_UNUSED_23; #endif #ifdef _LIB9P_GETATTR_UNUSED_24 - x = _LIB9P_GETATTR_UNUSED_24; + x = _LIB9P_GETATTR_UNUSED_24; #endif #ifdef _LIB9P_GETATTR_UNUSED_25 - x = _LIB9P_GETATTR_UNUSED_25; + x = _LIB9P_GETATTR_UNUSED_25; #endif #ifdef _LIB9P_GETATTR_UNUSED_26 - x = _LIB9P_GETATTR_UNUSED_26; + x = _LIB9P_GETATTR_UNUSED_26; #endif #ifdef _LIB9P_GETATTR_UNUSED_27 - x = _LIB9P_GETATTR_UNUSED_27; + x = _LIB9P_GETATTR_UNUSED_27; #endif #ifdef _LIB9P_GETATTR_UNUSED_28 - x = _LIB9P_GETATTR_UNUSED_28; + x = _LIB9P_GETATTR_UNUSED_28; #endif #ifdef _LIB9P_GETATTR_UNUSED_29 - x = _LIB9P_GETATTR_UNUSED_29; + x = _LIB9P_GETATTR_UNUSED_29; #endif #ifdef _LIB9P_GETATTR_UNUSED_30 - x = _LIB9P_GETATTR_UNUSED_30; + x = _LIB9P_GETATTR_UNUSED_30; #endif #ifdef _LIB9P_GETATTR_UNUSED_31 - x = _LIB9P_GETATTR_UNUSED_31; + x = _LIB9P_GETATTR_UNUSED_31; #endif #ifdef _LIB9P_GETATTR_UNUSED_32 - x = _LIB9P_GETATTR_UNUSED_32; + x = _LIB9P_GETATTR_UNUSED_32; #endif #ifdef _LIB9P_GETATTR_UNUSED_33 - x = _LIB9P_GETATTR_UNUSED_33; + x = _LIB9P_GETATTR_UNUSED_33; #endif #ifdef _LIB9P_GETATTR_UNUSED_34 - x = _LIB9P_GETATTR_UNUSED_34; + x = _LIB9P_GETATTR_UNUSED_34; #endif #ifdef _LIB9P_GETATTR_UNUSED_35 - x = _LIB9P_GETATTR_UNUSED_35; + x = _LIB9P_GETATTR_UNUSED_35; #endif #ifdef _LIB9P_GETATTR_UNUSED_36 - x = _LIB9P_GETATTR_UNUSED_36; + x = _LIB9P_GETATTR_UNUSED_36; #endif #ifdef _LIB9P_GETATTR_UNUSED_37 - x = _LIB9P_GETATTR_UNUSED_37; + x = _LIB9P_GETATTR_UNUSED_37; #endif #ifdef _LIB9P_GETATTR_UNUSED_38 - x = _LIB9P_GETATTR_UNUSED_38; + x = _LIB9P_GETATTR_UNUSED_38; #endif #ifdef _LIB9P_GETATTR_UNUSED_39 - x = _LIB9P_GETATTR_UNUSED_39; + x = _LIB9P_GETATTR_UNUSED_39; #endif #ifdef _LIB9P_GETATTR_UNUSED_40 - x = _LIB9P_GETATTR_UNUSED_40; + x = _LIB9P_GETATTR_UNUSED_40; #endif #ifdef _LIB9P_GETATTR_UNUSED_41 - x = _LIB9P_GETATTR_UNUSED_41; + x = _LIB9P_GETATTR_UNUSED_41; #endif #ifdef _LIB9P_GETATTR_UNUSED_42 - x = _LIB9P_GETATTR_UNUSED_42; + x = _LIB9P_GETATTR_UNUSED_42; #endif #ifdef _LIB9P_GETATTR_UNUSED_43 - x = _LIB9P_GETATTR_UNUSED_43; + x = _LIB9P_GETATTR_UNUSED_43; #endif #ifdef _LIB9P_GETATTR_UNUSED_44 - x = _LIB9P_GETATTR_UNUSED_44; + x = _LIB9P_GETATTR_UNUSED_44; #endif #ifdef _LIB9P_GETATTR_UNUSED_45 - x = _LIB9P_GETATTR_UNUSED_45; + x = _LIB9P_GETATTR_UNUSED_45; #endif #ifdef _LIB9P_GETATTR_UNUSED_46 - x = _LIB9P_GETATTR_UNUSED_46; + x = _LIB9P_GETATTR_UNUSED_46; #endif #ifdef _LIB9P_GETATTR_UNUSED_47 - x = _LIB9P_GETATTR_UNUSED_47; + x = _LIB9P_GETATTR_UNUSED_47; #endif #ifdef _LIB9P_GETATTR_UNUSED_48 - x = _LIB9P_GETATTR_UNUSED_48; + x = _LIB9P_GETATTR_UNUSED_48; #endif #ifdef _LIB9P_GETATTR_UNUSED_49 - x = _LIB9P_GETATTR_UNUSED_49; + x = _LIB9P_GETATTR_UNUSED_49; #endif #ifdef _LIB9P_GETATTR_UNUSED_50 - x = _LIB9P_GETATTR_UNUSED_50; + x = _LIB9P_GETATTR_UNUSED_50; #endif #ifdef _LIB9P_GETATTR_UNUSED_51 - x = _LIB9P_GETATTR_UNUSED_51; + x = _LIB9P_GETATTR_UNUSED_51; #endif #ifdef _LIB9P_GETATTR_UNUSED_52 - x = _LIB9P_GETATTR_UNUSED_52; + x = _LIB9P_GETATTR_UNUSED_52; #endif #ifdef _LIB9P_GETATTR_UNUSED_53 - x = _LIB9P_GETATTR_UNUSED_53; + x = _LIB9P_GETATTR_UNUSED_53; #endif #ifdef _LIB9P_GETATTR_UNUSED_54 - x = _LIB9P_GETATTR_UNUSED_54; + x = _LIB9P_GETATTR_UNUSED_54; #endif #ifdef _LIB9P_GETATTR_UNUSED_55 - x = _LIB9P_GETATTR_UNUSED_55; + x = _LIB9P_GETATTR_UNUSED_55; #endif #ifdef _LIB9P_GETATTR_UNUSED_56 - x = _LIB9P_GETATTR_UNUSED_56; + x = _LIB9P_GETATTR_UNUSED_56; #endif #ifdef _LIB9P_GETATTR_UNUSED_57 - x = _LIB9P_GETATTR_UNUSED_57; + x = _LIB9P_GETATTR_UNUSED_57; #endif #ifdef _LIB9P_GETATTR_UNUSED_58 - x = _LIB9P_GETATTR_UNUSED_58; + x = _LIB9P_GETATTR_UNUSED_58; #endif #ifdef _LIB9P_GETATTR_UNUSED_59 - x = _LIB9P_GETATTR_UNUSED_59; + x = _LIB9P_GETATTR_UNUSED_59; #endif #ifdef _LIB9P_GETATTR_UNUSED_60 - x = _LIB9P_GETATTR_UNUSED_60; + x = _LIB9P_GETATTR_UNUSED_60; #endif #ifdef _LIB9P_GETATTR_UNUSED_61 - x = _LIB9P_GETATTR_UNUSED_61; + x = _LIB9P_GETATTR_UNUSED_61; #endif #ifdef _LIB9P_GETATTR_UNUSED_62 - x = _LIB9P_GETATTR_UNUSED_62; + x = _LIB9P_GETATTR_UNUSED_62; #endif #ifdef _LIB9P_GETATTR_UNUSED_63 - x = _LIB9P_GETATTR_UNUSED_63; + x = _LIB9P_GETATTR_UNUSED_63; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_10 - x = _LIB9P_LOCK_FLAGS_UNUSED_10; + x = _LIB9P_LOCK_FLAGS_UNUSED_10; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_11 - x = _LIB9P_LOCK_FLAGS_UNUSED_11; + x = _LIB9P_LOCK_FLAGS_UNUSED_11; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_12 - x = _LIB9P_LOCK_FLAGS_UNUSED_12; + x = _LIB9P_LOCK_FLAGS_UNUSED_12; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_13 - x = _LIB9P_LOCK_FLAGS_UNUSED_13; + x = _LIB9P_LOCK_FLAGS_UNUSED_13; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_14 - x = _LIB9P_LOCK_FLAGS_UNUSED_14; + x = _LIB9P_LOCK_FLAGS_UNUSED_14; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_15 - x = _LIB9P_LOCK_FLAGS_UNUSED_15; + x = _LIB9P_LOCK_FLAGS_UNUSED_15; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_16 - x = _LIB9P_LOCK_FLAGS_UNUSED_16; + x = _LIB9P_LOCK_FLAGS_UNUSED_16; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_17 - x = _LIB9P_LOCK_FLAGS_UNUSED_17; + x = _LIB9P_LOCK_FLAGS_UNUSED_17; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_18 - x = _LIB9P_LOCK_FLAGS_UNUSED_18; + x = _LIB9P_LOCK_FLAGS_UNUSED_18; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_19 - x = _LIB9P_LOCK_FLAGS_UNUSED_19; + x = _LIB9P_LOCK_FLAGS_UNUSED_19; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_2 - x = _LIB9P_LOCK_FLAGS_UNUSED_2; + x = _LIB9P_LOCK_FLAGS_UNUSED_2; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_20 - x = _LIB9P_LOCK_FLAGS_UNUSED_20; + x = _LIB9P_LOCK_FLAGS_UNUSED_20; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_21 - x = _LIB9P_LOCK_FLAGS_UNUSED_21; + x = _LIB9P_LOCK_FLAGS_UNUSED_21; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_22 - x = _LIB9P_LOCK_FLAGS_UNUSED_22; + x = _LIB9P_LOCK_FLAGS_UNUSED_22; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_23 - x = _LIB9P_LOCK_FLAGS_UNUSED_23; + x = _LIB9P_LOCK_FLAGS_UNUSED_23; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_24 - x = _LIB9P_LOCK_FLAGS_UNUSED_24; + x = _LIB9P_LOCK_FLAGS_UNUSED_24; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_25 - x = _LIB9P_LOCK_FLAGS_UNUSED_25; + x = _LIB9P_LOCK_FLAGS_UNUSED_25; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_26 - x = _LIB9P_LOCK_FLAGS_UNUSED_26; + x = _LIB9P_LOCK_FLAGS_UNUSED_26; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_27 - x = _LIB9P_LOCK_FLAGS_UNUSED_27; + x = _LIB9P_LOCK_FLAGS_UNUSED_27; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_28 - x = _LIB9P_LOCK_FLAGS_UNUSED_28; + x = _LIB9P_LOCK_FLAGS_UNUSED_28; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_29 - x = _LIB9P_LOCK_FLAGS_UNUSED_29; + x = _LIB9P_LOCK_FLAGS_UNUSED_29; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_3 - x = _LIB9P_LOCK_FLAGS_UNUSED_3; + x = _LIB9P_LOCK_FLAGS_UNUSED_3; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_30 - x = _LIB9P_LOCK_FLAGS_UNUSED_30; + x = _LIB9P_LOCK_FLAGS_UNUSED_30; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_31 - x = _LIB9P_LOCK_FLAGS_UNUSED_31; + x = _LIB9P_LOCK_FLAGS_UNUSED_31; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_4 - x = _LIB9P_LOCK_FLAGS_UNUSED_4; + x = _LIB9P_LOCK_FLAGS_UNUSED_4; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_5 - x = _LIB9P_LOCK_FLAGS_UNUSED_5; + x = _LIB9P_LOCK_FLAGS_UNUSED_5; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_6 - x = _LIB9P_LOCK_FLAGS_UNUSED_6; + x = _LIB9P_LOCK_FLAGS_UNUSED_6; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_7 - x = _LIB9P_LOCK_FLAGS_UNUSED_7; + x = _LIB9P_LOCK_FLAGS_UNUSED_7; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_8 - x = _LIB9P_LOCK_FLAGS_UNUSED_8; + x = _LIB9P_LOCK_FLAGS_UNUSED_8; #endif #ifdef _LIB9P_LOCK_FLAGS_UNUSED_9 - x = _LIB9P_LOCK_FLAGS_UNUSED_9; + x = _LIB9P_LOCK_FLAGS_UNUSED_9; #endif #ifdef _LIB9P_LO_UNUSED_2 - x = _LIB9P_LO_UNUSED_2; + x = _LIB9P_LO_UNUSED_2; #endif #ifdef _LIB9P_LO_UNUSED_21 - x = _LIB9P_LO_UNUSED_21; + x = _LIB9P_LO_UNUSED_21; #endif #ifdef _LIB9P_LO_UNUSED_22 - x = _LIB9P_LO_UNUSED_22; + x = _LIB9P_LO_UNUSED_22; #endif #ifdef _LIB9P_LO_UNUSED_23 - x = _LIB9P_LO_UNUSED_23; + x = _LIB9P_LO_UNUSED_23; #endif #ifdef _LIB9P_LO_UNUSED_24 - x = _LIB9P_LO_UNUSED_24; + x = _LIB9P_LO_UNUSED_24; #endif #ifdef _LIB9P_LO_UNUSED_25 - x = _LIB9P_LO_UNUSED_25; + x = _LIB9P_LO_UNUSED_25; #endif #ifdef _LIB9P_LO_UNUSED_26 - x = _LIB9P_LO_UNUSED_26; + x = _LIB9P_LO_UNUSED_26; #endif #ifdef _LIB9P_LO_UNUSED_27 - x = _LIB9P_LO_UNUSED_27; + x = _LIB9P_LO_UNUSED_27; #endif #ifdef _LIB9P_LO_UNUSED_28 - x = _LIB9P_LO_UNUSED_28; + x = _LIB9P_LO_UNUSED_28; #endif #ifdef _LIB9P_LO_UNUSED_29 - x = _LIB9P_LO_UNUSED_29; + x = _LIB9P_LO_UNUSED_29; #endif #ifdef _LIB9P_LO_UNUSED_3 - x = _LIB9P_LO_UNUSED_3; + x = _LIB9P_LO_UNUSED_3; #endif #ifdef _LIB9P_LO_UNUSED_30 - x = _LIB9P_LO_UNUSED_30; + x = _LIB9P_LO_UNUSED_30; #endif #ifdef _LIB9P_LO_UNUSED_31 - x = _LIB9P_LO_UNUSED_31; + x = _LIB9P_LO_UNUSED_31; #endif #ifdef _LIB9P_LO_UNUSED_4 - x = _LIB9P_LO_UNUSED_4; + x = _LIB9P_LO_UNUSED_4; #endif #ifdef _LIB9P_LO_UNUSED_5 - x = _LIB9P_LO_UNUSED_5; + x = _LIB9P_LO_UNUSED_5; #endif #ifdef _LIB9P_MODE_UNUSED_16 - x = _LIB9P_MODE_UNUSED_16; + x = _LIB9P_MODE_UNUSED_16; #endif #ifdef _LIB9P_MODE_UNUSED_17 - x = _LIB9P_MODE_UNUSED_17; + x = _LIB9P_MODE_UNUSED_17; #endif #ifdef _LIB9P_MODE_UNUSED_18 - x = _LIB9P_MODE_UNUSED_18; + x = _LIB9P_MODE_UNUSED_18; #endif #ifdef _LIB9P_MODE_UNUSED_19 - x = _LIB9P_MODE_UNUSED_19; + x = _LIB9P_MODE_UNUSED_19; #endif #ifdef _LIB9P_MODE_UNUSED_20 - x = _LIB9P_MODE_UNUSED_20; + x = _LIB9P_MODE_UNUSED_20; #endif #ifdef _LIB9P_MODE_UNUSED_21 - x = _LIB9P_MODE_UNUSED_21; + x = _LIB9P_MODE_UNUSED_21; #endif #ifdef _LIB9P_MODE_UNUSED_22 - x = _LIB9P_MODE_UNUSED_22; + x = _LIB9P_MODE_UNUSED_22; #endif #ifdef _LIB9P_MODE_UNUSED_23 - x = _LIB9P_MODE_UNUSED_23; + x = _LIB9P_MODE_UNUSED_23; #endif #ifdef _LIB9P_MODE_UNUSED_24 - x = _LIB9P_MODE_UNUSED_24; + x = _LIB9P_MODE_UNUSED_24; #endif #ifdef _LIB9P_MODE_UNUSED_25 - x = _LIB9P_MODE_UNUSED_25; + x = _LIB9P_MODE_UNUSED_25; #endif #ifdef _LIB9P_MODE_UNUSED_26 - x = _LIB9P_MODE_UNUSED_26; + x = _LIB9P_MODE_UNUSED_26; #endif #ifdef _LIB9P_MODE_UNUSED_27 - x = _LIB9P_MODE_UNUSED_27; + x = _LIB9P_MODE_UNUSED_27; #endif #ifdef _LIB9P_MODE_UNUSED_28 - x = _LIB9P_MODE_UNUSED_28; + x = _LIB9P_MODE_UNUSED_28; #endif #ifdef _LIB9P_MODE_UNUSED_29 - x = _LIB9P_MODE_UNUSED_29; + x = _LIB9P_MODE_UNUSED_29; #endif #ifdef _LIB9P_MODE_UNUSED_30 - x = _LIB9P_MODE_UNUSED_30; + x = _LIB9P_MODE_UNUSED_30; #endif #ifdef _LIB9P_MODE_UNUSED_31 - x = _LIB9P_MODE_UNUSED_31; + x = _LIB9P_MODE_UNUSED_31; #endif #ifdef _LIB9P_O_RESERVED_CEXEC - x = _LIB9P_O_RESERVED_CEXEC; + x = _LIB9P_O_RESERVED_CEXEC; #endif #ifdef _LIB9P_O_UNUSED_2 - x = _LIB9P_O_UNUSED_2; + x = _LIB9P_O_UNUSED_2; #endif #ifdef _LIB9P_O_UNUSED_3 - x = _LIB9P_O_UNUSED_3; + x = _LIB9P_O_UNUSED_3; #endif #ifdef _LIB9P_O_UNUSED_7 - x = _LIB9P_O_UNUSED_7; + x = _LIB9P_O_UNUSED_7; #endif #ifdef _LIB9P_QT_PLAN9_MOUNT - x = _LIB9P_QT_PLAN9_MOUNT; + x = _LIB9P_QT_PLAN9_MOUNT; #endif #ifdef _LIB9P_QT_UNUSED_0 - x = _LIB9P_QT_UNUSED_0; + x = _LIB9P_QT_UNUSED_0; #endif #ifdef _LIB9P_SETATTR_UNUSED_10 - x = _LIB9P_SETATTR_UNUSED_10; + x = _LIB9P_SETATTR_UNUSED_10; #endif #ifdef _LIB9P_SETATTR_UNUSED_11 - x = _LIB9P_SETATTR_UNUSED_11; + x = _LIB9P_SETATTR_UNUSED_11; #endif #ifdef _LIB9P_SETATTR_UNUSED_12 - x = _LIB9P_SETATTR_UNUSED_12; + x = _LIB9P_SETATTR_UNUSED_12; #endif #ifdef _LIB9P_SETATTR_UNUSED_13 - x = _LIB9P_SETATTR_UNUSED_13; + x = _LIB9P_SETATTR_UNUSED_13; #endif #ifdef _LIB9P_SETATTR_UNUSED_14 - x = _LIB9P_SETATTR_UNUSED_14; + x = _LIB9P_SETATTR_UNUSED_14; #endif #ifdef _LIB9P_SETATTR_UNUSED_15 - x = _LIB9P_SETATTR_UNUSED_15; + x = _LIB9P_SETATTR_UNUSED_15; #endif #ifdef _LIB9P_SETATTR_UNUSED_16 - x = _LIB9P_SETATTR_UNUSED_16; + x = _LIB9P_SETATTR_UNUSED_16; #endif #ifdef _LIB9P_SETATTR_UNUSED_17 - x = _LIB9P_SETATTR_UNUSED_17; + x = _LIB9P_SETATTR_UNUSED_17; #endif #ifdef _LIB9P_SETATTR_UNUSED_18 - x = _LIB9P_SETATTR_UNUSED_18; + x = _LIB9P_SETATTR_UNUSED_18; #endif #ifdef _LIB9P_SETATTR_UNUSED_19 - x = _LIB9P_SETATTR_UNUSED_19; + x = _LIB9P_SETATTR_UNUSED_19; #endif #ifdef _LIB9P_SETATTR_UNUSED_20 - x = _LIB9P_SETATTR_UNUSED_20; + x = _LIB9P_SETATTR_UNUSED_20; #endif #ifdef _LIB9P_SETATTR_UNUSED_21 - x = _LIB9P_SETATTR_UNUSED_21; + x = _LIB9P_SETATTR_UNUSED_21; #endif #ifdef _LIB9P_SETATTR_UNUSED_22 - x = _LIB9P_SETATTR_UNUSED_22; + x = _LIB9P_SETATTR_UNUSED_22; #endif #ifdef _LIB9P_SETATTR_UNUSED_23 - x = _LIB9P_SETATTR_UNUSED_23; + x = _LIB9P_SETATTR_UNUSED_23; #endif #ifdef _LIB9P_SETATTR_UNUSED_24 - x = _LIB9P_SETATTR_UNUSED_24; + x = _LIB9P_SETATTR_UNUSED_24; #endif #ifdef _LIB9P_SETATTR_UNUSED_25 - x = _LIB9P_SETATTR_UNUSED_25; + x = _LIB9P_SETATTR_UNUSED_25; #endif #ifdef _LIB9P_SETATTR_UNUSED_26 - x = _LIB9P_SETATTR_UNUSED_26; + x = _LIB9P_SETATTR_UNUSED_26; #endif #ifdef _LIB9P_SETATTR_UNUSED_27 - x = _LIB9P_SETATTR_UNUSED_27; + x = _LIB9P_SETATTR_UNUSED_27; #endif #ifdef _LIB9P_SETATTR_UNUSED_28 - x = _LIB9P_SETATTR_UNUSED_28; + x = _LIB9P_SETATTR_UNUSED_28; #endif #ifdef _LIB9P_SETATTR_UNUSED_29 - x = _LIB9P_SETATTR_UNUSED_29; + x = _LIB9P_SETATTR_UNUSED_29; #endif #ifdef _LIB9P_SETATTR_UNUSED_30 - x = _LIB9P_SETATTR_UNUSED_30; + x = _LIB9P_SETATTR_UNUSED_30; #endif #ifdef _LIB9P_SETATTR_UNUSED_31 - x = _LIB9P_SETATTR_UNUSED_31; + x = _LIB9P_SETATTR_UNUSED_31; #endif #ifdef _LIB9P_SETATTR_UNUSED_9 - x = _LIB9P_SETATTR_UNUSED_9; + x = _LIB9P_SETATTR_UNUSED_9; #endif - return 0; + return 0; } diff --git a/lib9p/tests/test_compile.c.gen b/lib9p/tests/test_compile.c.gen index c57ce9f..ef2aee6 100755 --- a/lib9p/tests/test_compile.c.gen +++ b/lib9p/tests/test_compile.c.gen @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # lib9p/tests/test_compile.c.gen - Generate code to make sure all generated macros work # # Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> @@ -12,8 +12,8 @@ outfile=$2 echo echo "#include <lib9p/core.h>" echo 'int main(void) {' - echo ' [[maybe_unused]] uint64_t x;' - <"$generated_h" sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/\1/p' | LC_COLLATE=C sort -u | sed 's/.*/#ifdef &\n x = &;\n#endif/' - echo ' return 0;' + echo $'\t[[maybe_unused]] uint64_t x;' + <"$generated_h" sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/\1/p' | LC_COLLATE=C sort -u | sed $'s/.*/#ifdef &\\n\tx = &;\\n#endif/' + echo $'\treturn 0;' echo '}' } >"$outfile" diff --git a/lib9p/tests/test_server/fs_flush.h b/lib9p/tests/test_server/fs_flush.h index a509c4a..2b08850 100644 --- a/lib9p/tests/test_server/fs_flush.h +++ b/lib9p/tests/test_server/fs_flush.h @@ -7,8 +7,8 @@ #ifndef _LIB9P_TESTS_TEST_SERVER_FS_FLUSH_H_ #define _LIB9P_TESTS_TEST_SERVER_FS_FLUSH_H_ -#include <util9p/static.h> #include <libhw/host_net.h> +#include <util9p/static.h> struct flush_file { char *name; diff --git a/lib9p/tests/test_server/fs_shutdown.h b/lib9p/tests/test_server/fs_shutdown.h index 65956db..6b8683c 100644 --- a/lib9p/tests/test_server/fs_shutdown.h +++ b/lib9p/tests/test_server/fs_shutdown.h @@ -7,8 +7,8 @@ #ifndef _LIB9P_TESTS_TEST_SERVER_FS_SHUTDOWN_H_ #define _LIB9P_TESTS_TEST_SERVER_FS_SHUTDOWN_H_ -#include <util9p/static.h> #include <libhw/host_net.h> +#include <util9p/static.h> struct shutdown_file { char *name; diff --git a/lib9p/tests/test_server/fs_whoami.c b/lib9p/tests/test_server/fs_whoami.c index 8d9752a..7e1d635 100644 --- a/lib9p/tests/test_server/fs_whoami.c +++ b/lib9p/tests/test_server/fs_whoami.c @@ -4,8 +4,9 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <stdio.h> /* for snprintf() */ -#include <stdlib.h> /* for realloc(), free() */ +#include <inttypes.h> /* for PRI* */ +#include <stdio.h> /* for snprintf() */ +#include <stdlib.h> /* for realloc(), free() */ #include <libmisc/alloc.h> diff --git a/lib9p/tests/test_server/fs_whoami.h b/lib9p/tests/test_server/fs_whoami.h index 0d3d311..5e1aee9 100644 --- a/lib9p/tests/test_server/fs_whoami.h +++ b/lib9p/tests/test_server/fs_whoami.h @@ -7,8 +7,8 @@ #ifndef _LIB9P_TESTS_TEST_SERVER_FS_WHOAMI_H_ #define _LIB9P_TESTS_TEST_SERVER_FS_WHOAMI_H_ -#include <util9p/static.h> #include <libhw/host_net.h> +#include <util9p/static.h> struct whoami_file { char *name; diff --git a/lib9p/tests/test_server/main.c b/lib9p/tests/test_server/main.c index 4caff16..f2a73bf 100644 --- a/lib9p/tests/test_server/main.c +++ b/lib9p/tests/test_server/main.c @@ -4,24 +4,24 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <error.h> #include <errno.h> +#include <error.h> #include <stdio.h> #include <stdlib.h> /* for atoi() */ #include <lib9p/srv.h> #include <libcr/coroutine.h> -#include <libhw/generic/net.h> #include <libhw/generic/alarmclock.h> +#include <libhw/generic/net.h> #include <libhw/host_alarmclock.h> #include <libhw/host_net.h> #include <libmisc/macro.h> #include <util9p/static.h> -#include "static.h" #include "fs_flush.h" #include "fs_shutdown.h" #include "fs_whoami.h" +#include "static.h" /* configuration **************************************************************/ diff --git a/lib9p/tests/testclient-sess.c b/lib9p/tests/testclient-sess.c index 7cb7f97..eef9d2c 100644 --- a/lib9p/tests/testclient-sess.c +++ b/lib9p/tests/testclient-sess.c @@ -8,14 +8,14 @@ #include <errno.h> #include <error.h> #include <netinet/in.h> /* for struct sockaddr{,_in} */ -#include <stdlib.h> /* for atoi() */ +#include <stdlib.h> /* for atoi() */ #include <sys/socket.h> /* for socket(), connect() */ -#include <sys/uio.h> /* for writev() */ -#include <unistd.h> /* for read() */ +#include <sys/uio.h> /* for writev() */ +#include <unistd.h> /* for read() */ +#include <lib9p/core.h> #include <libmisc/assert.h> #include <libmisc/endian.h> -#include <lib9p/core.h> #define MAX_MSG_SIZE (8*1024) diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 920c371..baa559b 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -685,7 +685,7 @@ void cr_begin(void) { cr_restore_interrupts(saved); } -static inline void _cr_yield() { +static inline void _cr_yield(void) { cid_t next; while ( !((next = coroutine_ringbuf_pop())) ) { /* No coroutines are runnable, wait for an interrupt diff --git a/libcr/include/libcr/coroutine.h b/libcr/include/libcr/coroutine.h index f72dc96..f566074 100644 --- a/libcr/include/libcr/coroutine.h +++ b/libcr/include/libcr/coroutine.h @@ -26,7 +26,7 @@ #ifndef _LIBCR_COROUTINE_H_ #define _LIBCR_COROUTINE_H_ -#include <stddef.h> /* for size_t */ +#include <stddef.h> /* for size_t */ /* Configuration **************************************************************/ diff --git a/libcr_ipc/chan.c b/libcr_ipc/chan.c index b7ecfc8..b52dab1 100644 --- a/libcr_ipc/chan.c +++ b/libcr_ipc/chan.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <string.h> /* for memcpy() */ +#include <string.h> /* for memcpy() */ #include <libcr/coroutine.h> /* for cid_t, cr_* */ #include <libmisc/assert.h> diff --git a/libcr_ipc/include/libcr_ipc/chan.h b/libcr_ipc/include/libcr_ipc/chan.h index 09d269f..1755a97 100644 --- a/libcr_ipc/include/libcr_ipc/chan.h +++ b/libcr_ipc/include/libcr_ipc/chan.h @@ -7,7 +7,7 @@ #ifndef _LIBCR_IPC_CHAN_H_ #define _LIBCR_IPC_CHAN_H_ -#include <stddef.h> /* for size_t */ +#include <stddef.h> /* for size_t */ #include <libmisc/linkedlist.h> /* for DLIST_DECLARE() */ #include <libmisc/private.h> diff --git a/libcr_ipc/rpc.c b/libcr_ipc/rpc.c index fcf51ba..b1b7674 100644 --- a/libcr_ipc/rpc.c +++ b/libcr_ipc/rpc.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <string.h> /* for memcpy() */ +#include <string.h> /* for memcpy() */ #include <libcr/coroutine.h> /* for cid_t, cr_* */ #include <libmisc/assert.h> diff --git a/libcr_ipc/tests/test_chan.c b/libcr_ipc/tests/test_chan.c index a6eba82..759c2b1 100644 --- a/libcr_ipc/tests/test_chan.c +++ b/libcr_ipc/tests/test_chan.c @@ -22,7 +22,6 @@ COROUTINE producer_cr(void *_ch) { cr_chan_send(ch, 2); - cr_end(); } diff --git a/libdhcp/dhcp_client.c b/libdhcp/dhcp_client.c index 8e8361d..bf88961 100644 --- a/libdhcp/dhcp_client.c +++ b/libdhcp/dhcp_client.c @@ -86,8 +86,8 @@ #include <string.h> /* for strlen(), memcpy(), memset() */ -#include <libmisc/rand.h> #include <libhw/generic/alarmclock.h> +#include <libmisc/rand.h> #define LOG_NAME DHCP #include <libmisc/log.h> diff --git a/libhw_cr/host_include/libhw/host_alarmclock.h b/libhw_cr/host_include/libhw/host_alarmclock.h index 3cc43c1..2ddb054 100644 --- a/libhw_cr/host_include/libhw/host_alarmclock.h +++ b/libhw_cr/host_include/libhw/host_alarmclock.h @@ -7,10 +7,10 @@ #ifndef _LIBHW_HOST_ALARMCLOCK_H_ #define _LIBHW_HOST_ALARMCLOCK_H_ -#include <time.h> /* for clockid_t, timer_t */ +#include <time.h> /* for clockid_t, timer_t */ -#include <libmisc/private.h> #include <libhw/generic/alarmclock.h> +#include <libmisc/private.h> struct hostclock { clockid_t clock_id; diff --git a/libhw_cr/host_util.h b/libhw_cr/host_util.h index 02c04dc..3f0a671 100644 --- a/libhw_cr/host_util.h +++ b/libhw_cr/host_util.h @@ -7,8 +7,8 @@ #ifndef _LIBHW_CR_HOST_UTIL_H_ #define _LIBHW_CR_HOST_UTIL_H_ -#include <time.h> /* for struct timespec */ -#include <sys/time.h> /* for struct timeval */ +#include <sys/time.h> /* for struct timeval */ +#include <time.h> /* for struct timespec */ #include <libhw/generic/alarmclock.h> /* for {X}S_PER_S */ diff --git a/libhw_cr/rp2040_dma.h b/libhw_cr/rp2040_dma.h index c7f5a8f..e8bceec 100644 --- a/libhw_cr/rp2040_dma.h +++ b/libhw_cr/rp2040_dma.h @@ -27,9 +27,9 @@ static inline dma_channel_hw_t *dma_channel_hw_addr(uint channel) { } enum dma_channel_transfer_size { - DMA_SIZE_8 = 0, ///< Byte transfer (8 bits) - DMA_SIZE_16 = 1, ///< Half word transfer (16 bits) - DMA_SIZE_32 = 2 ///< Word transfer (32 bits) + DMA_SIZE_8 = 0, ///< Byte transfer (8 bits) + DMA_SIZE_16 = 1, ///< Half word transfer (16 bits) + DMA_SIZE_32 = 2 ///< Word transfer (32 bits) }; /* Our own code ***************************************************************/ diff --git a/libhw_cr/rp2040_gpioirq.c b/libhw_cr/rp2040_gpioirq.c index 5b3d616..ecbdb04 100644 --- a/libhw_cr/rp2040_gpioirq.c +++ b/libhw_cr/rp2040_gpioirq.c @@ -4,8 +4,8 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +#include <hardware/irq.h> /* for irq_set_exclusive_handler() */ #include <hardware/structs/io_bank0.h> /* for io_bank0_hw */ -#include <hardware/irq.h> /* for irq_set_exclusive_handler() */ #include <libmisc/macro.h> diff --git a/libhw_cr/rp2040_hwspi.c b/libhw_cr/rp2040_hwspi.c index 75acd58..a7840e8 100644 --- a/libhw_cr/rp2040_hwspi.c +++ b/libhw_cr/rp2040_hwspi.c @@ -4,8 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <inttypes.h> /* for PRIu{n} */ - #include <hardware/clocks.h> /* for clock_get_hz() and clk_peri */ #include <hardware/gpio.h> #include <hardware/spi.h> diff --git a/libhw_cr/w5500.c b/libhw_cr/w5500.c index 6f3f302..b7c2ad1 100644 --- a/libhw_cr/w5500.c +++ b/libhw_cr/w5500.c @@ -67,12 +67,10 @@ * SPDX-License-Identifier: MIT */ -#include <inttypes.h> /* for PRIu{n} */ - /* TODO: Write a <libhw/generic/gpio.h> to avoid w5500.c being * pico-sdk-specific. */ -#include <hardware/gpio.h> /* pico-sdk:hardware_gpio */ #include "rp2040_gpioirq.h" +#include <hardware/gpio.h> /* pico-sdk:hardware_gpio */ #include <libcr/coroutine.h> /* for cr_yield() */ diff --git a/libhw_generic/include/libhw/generic/alarmclock.h b/libhw_generic/include/libhw/generic/alarmclock.h index 6ce2513..7f603cb 100644 --- a/libhw_generic/include/libhw/generic/alarmclock.h +++ b/libhw_generic/include/libhw/generic/alarmclock.h @@ -7,7 +7,7 @@ #ifndef _LIBHW_GENERIC_ALARMCLOCK_H_ #define _LIBHW_GENERIC_ALARMCLOCK_H_ -#include <stdint.h> /* for uint{n}_t and UINT{n}_C */ +#include <stdint.h> /* for uint{n}_t and UINT{n}_C */ #include <libmisc/obj.h> #include <libmisc/private.h> diff --git a/libhw_generic/include/libhw/generic/net.h b/libhw_generic/include/libhw/generic/net.h index 573a01f..04d1082 100644 --- a/libhw_generic/include/libhw/generic/net.h +++ b/libhw_generic/include/libhw/generic/net.h @@ -7,13 +7,12 @@ #ifndef _LIBHW_GENERIC_NET_H_ #define _LIBHW_GENERIC_NET_H_ -#include <inttypes.h> /* for PRI{u,x}{n} */ #include <stddef.h> /* for size_t */ #include <stdint.h> /* for uint{n}_t} */ #include <sys/types.h> /* for ssize_t */ -#include <libmisc/fmt.h> #include <libhw/generic/io.h> +#include <libmisc/fmt.h> /* Errnos *********************************************************************/ diff --git a/libmisc/assert.c b/libmisc/assert.c index cb3a270..410ec21 100644 --- a/libmisc/assert.c +++ b/libmisc/assert.c @@ -11,8 +11,8 @@ #ifndef NDEBUG void __assert_msg_fail(const char *expr, - const char *file, unsigned int line, const char *func, - const char *msg) { + const char *file, unsigned int line, const char *func, + const char *msg) { static bool in_fail = false; if (!in_fail) { in_fail = true; diff --git a/libmisc/fmt.c b/libmisc/fmt.c index 33788b6..6cf1d8d 100644 --- a/libmisc/fmt.c +++ b/libmisc/fmt.c @@ -6,6 +6,8 @@ #include <string.h> /* for strnlen() */ +#include <libmisc/utf8.h> + #include <libmisc/fmt.h> static const char *const hexdig = "0123456789ABCDEF"; @@ -67,19 +69,18 @@ void fmt_print_qmem(lo_interface fmt_dest w, const void *_str, size_t size) { fmt_print_byte(w, '"'); for (size_t pos = 0; pos < size;) { uint32_t ch; - uint8_t chlen; - if ((str[pos] & 0b10000000) == 0b00000000) { ch = str[pos] & 0b01111111; chlen = 1; } - else if ((str[pos] & 0b11100000) == 0b11000000) { ch = str[pos] & 0b00011111; chlen = 2; } - else if ((str[pos] & 0b11110000) == 0b11100000) { ch = str[pos] & 0b00001111; chlen = 3; } - else if ((str[pos] & 0b11111000) == 0b11110000) { ch = str[pos] & 0b00000111; chlen = 4; } - else goto invalid_utf8; - if ((ch == 0 && chlen != 1) || pos + chlen > size) goto invalid_utf8; - for (uint8_t i = 1; i < chlen; i++) { - if ((str[pos+i] & 0b11000000) != 0b10000000) goto invalid_utf8; - ch = (ch << 6) | (str[pos+i] & 0b00111111); + uint8_t chlen; + utf8_decode_codepoint(&str[pos], size-pos, &ch, &chlen); + if (!chlen) { + /* invalid UTF-8 */ + /* \xAB */ + fmt_print_byte(w, '\\'); + fmt_print_byte(w, 'x'); + fmt_print_byte(w, hexdig[(str[pos] >> 4) & 0xF]); + fmt_print_byte(w, hexdig[(str[pos] >> 0) & 0xF]); + pos++; + continue; } - if (ch > 0x10FFFF) goto invalid_utf8; - if (ch == '\0' || ch == '\b' || ch == '\f' || @@ -132,15 +133,6 @@ void fmt_print_qmem(lo_interface fmt_dest w, const void *_str, size_t size) { fmt_print_byte(w, hexdig[(ch >> 0) & 0xF]); } pos += chlen; - continue; - - invalid_utf8: - /* \xAB */ - fmt_print_byte(w, '\\'); - fmt_print_byte(w, 'x'); - fmt_print_byte(w, hexdig[(str[pos] >> 4) & 0xF]); - fmt_print_byte(w, hexdig[(str[pos] >> 0) & 0xF]); - pos++; } fmt_print_byte(w, '"'); } diff --git a/libmisc/include/libmisc/hash.h b/libmisc/include/libmisc/hash.h index 91e6b10..58a895f 100644 --- a/libmisc/include/libmisc/hash.h +++ b/libmisc/include/libmisc/hash.h @@ -1,14 +1,14 @@ /* libmisc/hash.h - General-purpose hash utilities * - * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-License-Identifier: AGPL-3.0-or-later */ #ifndef _LIBMISC_HASH_H_ #define _LIBMISC_HASH_H_ -#include <stdint.h> /* for uint{n}_t */ #include <stddef.h> /* for size_t */ +#include <stdint.h> /* for uint{n}_t */ /* djb2 hash */ typedef uint32_t hash_t; diff --git a/libmisc/include/libmisc/log.h b/libmisc/include/libmisc/log.h index e6dfb52..c40b642 100644 --- a/libmisc/include/libmisc/log.h +++ b/libmisc/include/libmisc/log.h @@ -9,9 +9,9 @@ #include <stdint.h> /* for uint8_t */ -#include <libmisc/macro.h> -#include <libmisc/fmt.h> #include <libmisc/_intercept.h> +#include <libmisc/fmt.h> +#include <libmisc/macro.h> #ifdef NDEBUG #define _LOG_NDEBUG 1 diff --git a/libmisc/include/libmisc/utf8.h b/libmisc/include/libmisc/utf8.h new file mode 100644 index 0000000..b5e1b0b --- /dev/null +++ b/libmisc/include/libmisc/utf8.h @@ -0,0 +1,54 @@ +/* libmisc/utf8.h - UTF-8 routines + * + * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _LIBMISC_UTF8_H_ +#define _LIBMISC_UTF8_H_ + +#include <stddef.h> /* for size_t */ +#include <stdint.h> /* for uint{n}_t */ + +/** + * Decode the codepoint starting at `str` and consuming at most `len` + * bytes. Invalid UTF-8 is indicated with chlen=0. For valid UTF-8, + * chlen is always in the range [1, 4]. + */ +static inline void utf8_decode_codepoint(const uint8_t *str, size_t len, uint32_t *ret_ch, uint8_t *ret_chlen) { + uint32_t ch; + uint8_t chlen; + if ((str[0] & 0b10000000) == 0b00000000) { ch = str[0] & 0b01111111; chlen = 1; } + else if ((str[0] & 0b11100000) == 0b11000000) { ch = str[0] & 0b00011111; chlen = 2; } + else if ((str[0] & 0b11110000) == 0b11100000) { ch = str[0] & 0b00001111; chlen = 3; } + else if ((str[0] & 0b11111000) == 0b11110000) { ch = str[0] & 0b00000111; chlen = 4; } + else goto invalid; + if ((ch == 0 && chlen != 1) || chlen > len) goto invalid; + for (uint8_t i = 1; i < chlen; i++) { + if ((str[i] & 0b11000000) != 0b10000000) goto invalid; + ch = (ch << 6) | (str[i] & 0b00111111); + } + if (ch > 0x10FFFF) goto invalid; + *ret_ch = ch; + *ret_chlen = chlen; + return; + invalid: + *ret_chlen = 0; +} + +static inline bool _utf8_is_valid(const uint8_t *str, size_t len, bool forbid_nul) { + for (size_t pos = 0; pos < len;) { + uint32_t ch; + uint8_t chlen; + utf8_decode_codepoint(&str[pos], len-pos, &ch, &chlen); + if (chlen == 0 || (forbid_nul && ch == 0)) + return false; + pos += chlen; + } + return true; +} + +#define utf8_is_valid(str, len) _utf8_is_valid(str, len, false) +#define utf8_is_valid_without_nul(str, len) _utf8_is_valid(str, len, true) + +#endif /* _LIBMISC_UTF8_H_ */ diff --git a/libmisc/intercept.c b/libmisc/intercept.c index 30870bf..d0e3602 100644 --- a/libmisc/intercept.c +++ b/libmisc/intercept.c @@ -11,7 +11,7 @@ [[gnu::weak]] void __lm_putchar(unsigned char c) { - (void) putchar(c); + (void)putchar(c); } [[gnu::weak]] diff --git a/libmisc/log.c b/libmisc/log.c index da4c92e..7e917c6 100644 --- a/libmisc/log.c +++ b/libmisc/log.c @@ -8,8 +8,8 @@ #include <libmisc/assert.h> /* for static_assert() */ -#include <libmisc/log.h> #include <libmisc/_intercept.h> +#include <libmisc/log.h> struct log_stdout {}; LO_IMPLEMENTATION_H(fmt_dest, struct log_stdout, log_stdout); diff --git a/libmisc/map.c b/libmisc/map.c index cc34c16..d1b2a57 100644 --- a/libmisc/map.c +++ b/libmisc/map.c @@ -7,9 +7,9 @@ #include <stdlib.h> #include <string.h> -#include <libmisc/hash.h> #include <libmisc/alloc.h> #include <libmisc/assert.h> +#include <libmisc/hash.h> #include <libmisc/map.h> #define FLAG_ITER (UINT8_C(1)<<0) diff --git a/libmisc/tests/test_rand.c b/libmisc/tests/test_rand.c index ecb1c49..1cfbd65 100644 --- a/libmisc/tests/test_rand.c +++ b/libmisc/tests/test_rand.c @@ -6,8 +6,8 @@ #include <setjmp.h> -#include <libmisc/rand.h> #include <libmisc/_intercept.h> +#include <libmisc/rand.h> #include "test.h" diff --git a/libusb/usb_common.c b/libusb/usb_common.c index 32aa53f..4fe7dd4 100644 --- a/libusb/usb_common.c +++ b/libusb/usb_common.c @@ -4,12 +4,12 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <stdint.h> /* for uint{n}_t types */ -#include <stddef.h> /* for size_t */ -#include <string.h> /* memcpy() */ -#include <stdlib.h> /* for malloc(), realloc(), reallocarray() */ +#include <stddef.h> /* for size_t */ +#include <stdint.h> /* for uint{n}_t types */ +#include <stdlib.h> /* for malloc(), realloc(), reallocarray() */ +#include <string.h> /* memcpy() */ -#include <tusb.h> /* for various tusb_*_t types */ +#include <tusb.h> /* for various tusb_*_t types */ #include <libmisc/assert.h> @@ -100,8 +100,7 @@ void usb_common_lateinit(void) { tud_init(CONFIG_USB_COMMON_RHPORT); } -COROUTINE usb_common_cr(void *_arg) { - (void) _arg; +COROUTINE usb_common_cr(void *LM_UNUSED(_arg)) { cr_begin(); for (;;) { @@ -185,7 +184,7 @@ uint8_t const *tud_descriptor_device_cb(void) { .bNumConfigurations = 0, /* Number of possible configurations */ }; desc.bNumConfigurations = globals.configc; - return (uint8_t const *) &desc; + return (uint8_t const *)&desc; } /** |