gensio_bswap(3)
π gensio_bswap β the Library Functions Manual, but make it cute π
okay bestie, this is gensio_bswap(3) from the Library Functions Manual and it's literally just byte swapping, no drama, and honestly? slay. let's get into it π¦
β¨ NAME β¨
gensio_bswap_16, gensio_bswap_32, gensio_bswap_64, GENSIO_IS_BIG_ENDIAN, GENSIO_IS_LITTLE_ENDIAN, gensio_bswap_16_from_be, gensio_bswap_32_from_be, gensio_bswap_64_from_be, gensio_bswap_16_to_be, gensio_bswap_32_to_be, gensio_bswap_64_to_be, gensio_bswap_16_from_le, gensio_bswap_32_from_le, gensio_bswap_64_from_le, gensio_bswap_16_to_le, gensio_bswap_32_to_le, gensio_bswap_64_to_le β Byte swapping routines. periodt. π
π SYNOPSIS π
#include <gensio/gensio_byteswap.h>
uint[16|32|64]_t gensio_bswap_[16|32|64](v)
uint[16|32|64]_t gensio_bswap_[16|32|64]_[from|to]_[be|le](v)
π DESCRIPTION π
so these routines do the normal byte swapping thing in 16, 32, and 64-bit values. classic. iconic. no cap.
gensio_bswap_[16|32|64]()β this one does an unconditional byte swap. it does not care about your host, it does not read the room, it just swaps. main character energy fr fr π₯gensio_bswap_[16|32|64]_[from|to]_[be|le]β these cuties byte swap from/to the given endianness, and the actual swapping that happens depends on your host platform's endianness. iykyk πGENSIO_IS_BIG_ENDIANandGENSIO_IS_LITTLE_ENDIANβ these will be true or false depending on the host endian's endianness. yes bestie, the vibes check your machine for you π«Ά
β RETURN VALUES β
the integer, byte swapped, will be returned. that's it, that's the whole return value, and honestly it ate π
πΈ SEE ALSO πΈ
and that's the whole page bestie, go forth and swap those bytes responsibly π§
this gem is from gensio_bswap(3) and the footer says 04 Jan 2025 β so if your byte order is looking a little cursed, blame the date, not me πβ¨
π¦ where this page comes from
- alpine 3.22: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.23: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.24: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- arch rolling: gensio 3.0.4-1 Β· GPL
- debian trixie: libgensio-dev 2.8.13-7 Β· GPL-2.0-only
- epel 9: libgensio-devel 2.8.15-1.el9 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- nixos 26.05: gensio 3.0.2
- nixpkgs unstable: gensio 3.0.2
- ubuntu questing: libgensio-dev 2.8.13-7
- ubuntu resolute: libgensio-dev 3.0.0-1build1 Β· GPL-2.0-only
- ubuntu stonking: libgensio-dev 3.0.0-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms