MS_GSWAP(3)

πŸ“¦
version 2.19.8 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’« MS_GSWAP β€” bestie edition πŸ’«

ok so we're doing ms_gswap(3) today and honestly? it's giving generalized, in-place byte swapping routines. that's the name, that's the vibe, that's the whole assignment. πŸŽ€


✨ SYNOPSIS ✨

#include <libmseed.h>

void  ms_gswap2 ( void *data2 );

void  ms_gswap3 ( void *data3 );

void  ms_gswap4 ( void *data4 );

void  ms_gswap8 ( void *data8 );

void  ms_gswap2a ( void *data2 );

void  ms_gswap4a ( void *data4 );

void  ms_gswap8a ( void *data8 );

like. look at them. seven little icons. all of them returning void, all of them taking one pointer, all of them here to flip your bytes. πŸ’…


🌸 DESCRIPTION 🌸

so here's the tea, bestie: these routines swap between LSBF (little-endian) and MSBF (big-endian) byte orders. that's the entire personality. and the specified quantities? they get swapped in-place. no copies, no new buffer, no drama β€” it just reaches into your memory and rearranges the furniture. ✨

the ms_gswap*a routines are provided for backwards compatibility, but β€” and I need you to hear me on this β€” they should not be used in new code. they're literally just aliases for the regular versions above. same energy, older fit. if you're writing something fresh, use the non-a ones, periodt. πŸ’€

🫢 tl;dr: 2, 3, 4, 8 are your mains. 2a, 4a, 8a are the throwback versions that only exist so old code doesn't break. iconic of them to stay, but let's not make it a thing.

πŸ‘‘ AUTHOR πŸ‘‘

  • Chad Trabant
  • IRIS Data Management Center

and that's the whole page, bestie πŸ¦‹ no cap, that's literally all of it β€” you're so welcome πŸ’–

this lil masterpiece comes to you from the Libmseed API, dated 2006/12/20, filed under MS_GSWAP(3). drink some water, swap your bytes responsibly, mwah 😭🌸