From 41ee6b43c89ce67808a684ba67f69e964b0636fa Mon Sep 17 00:00:00 2001 From: aqua Date: Sat, 18 Feb 2023 10:12:24 +0200 Subject: Move C stdlib to lib/libk --- lib/libk/endian.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/libk/endian.h (limited to 'lib/libk/endian.h') diff --git a/lib/libk/endian.h b/lib/libk/endian.h new file mode 100644 index 0000000..70bc5f7 --- /dev/null +++ b/lib/libk/endian.h @@ -0,0 +1,17 @@ +//===================================================================== +// spdx-license-identifier: ISC +//===================================================================== + +#pragma once + +#include + +// These functions convert the byte encoding of integer values from host byte order to and from little-endian and +// big-endian byte order +uint16_t htole16(uint16_t host_16b); +uint32_t htole32(uint32_t host_32b); +uint64_t htole64(uint64_t host_64b); + +uint16_t htobe16(uint16_t host_16b); +uint32_t htobe32(uint32_t host_32b); +uint64_t htobe64(uint64_t host_64b); -- cgit v1.2.1