gd_encoding_support(3)

πŸ’– gd_encoding_support(3) πŸ’–

okay bestie, so this one lives in the GETDATA manual section, and it's literally the "does my library even do this encoding" vibe check. sit down, hydrate, let's go 🫢


✨ NAME ✨

gd_encoding_support β€” determine GetData library support for data encodings


🌸 SYNOPSIS 🌸

#include <getdata.h>

int gd_encoding_support(unsigned long encoding);

πŸŽ€ DESCRIPTION πŸŽ€

so the gd_encoding_support() function is basically the group chat poll: it reports whether the Dirfile encoding you passed in as encoding is supported by the GetData library. πŸ’…

and the encoding argument should be one of these symbols, indicating the encoding type:

  • GD_UNENCODED
  • GD_BZIP2_ENCODED
  • GD_FLAC_ENCODED
  • GD_GZIP_ENCODED
  • GD_LZMA_ENCODED
  • GD_SIE_ENCODED
  • GD_SLIM_ENCODED
  • GD_TEXT_ENCODED
  • GD_ZZIP_ENCODED
  • GD_ZZSLIM_ENCODED

if you're like "bestie what do these even mean" β€” no worries, go peek at gd_open(3) and dirfile-encoding(5), they explain the meanings of these symbols and give you the details on the known encoding schemes. ✨


πŸ¦‹ RETURN VALUE πŸ¦‹

here's the tea, the function returns one of three things:

  • GD_RDWR β€” the GetData library can read from and write to the specified encoding πŸ‘‘
  • GD_RDONLY β€” the GetData library can only read from the specified encoding
  • -1 β€” neither reading nor writing is supported, or encoding wasn't one of the symbols listed above 😭

πŸ’€ NOTES πŸ’€

ngl this part matters, so pay attention.

GetData's encoding support framework is way more finely grained than the three-way system this function reports. it's totally possible for the library to have partial support for reading or writing a particular encoding. so this function will only report positive support if all functions of a given class (read-only or read-write) are supported. no half-credit, periodt.

also, encoding types can have multiple subtypes with different degrees of support. this function reports the support of the most supported subtype. for example, the LZMA encoding framework can read both the .lzma and .xz container formats, but only write .xz files. so if LZMA support is available, this function will return GD_RDWR when passed GD_LZMA_ENCODED. 🧚

so yeah β€” when you get GD_RDWR back, that's the best case across subtypes, not a promise that every single container format is writable. iykyk πŸ’…

🌈 HISTORY 🌈

the gd_encoding_support() function appeared in GetData-0.9.0. a legend was born, fr fr ⭐


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie!! this one's Version 0.10.0, dated 25 December 2016 β€” a lil holiday gift from the GetData girlies πŸŽπŸ’– mwah, go write some encodings, ily πŸ¦‹πŸŒΈπŸ’