gd_encoding(3)
π gd_encoding β bestie, what's the vibe of this data?? π
okay so this is gd_encoding(3), a page from the GETDATA manual, and honestly? she's a little icon. she tells you how the data in your dirfile is encoded. let's get into it β¨
β¨ SYNOPSIS β¨
#include <getdata.h>
unsigned long gd_encoding(DIRFILE *dirfile, int fragment_index);
like yes, that's the whole thing. two arguments. she's lowkey simple and we love her for it π«Ά
πΈ DESCRIPTION πΈ
okay so gd_encoding() goes and queries a dirfile(5) database β that's the one you pass in as dirfile β and it hands you back the data encoding for the fragment indexed by fragment_index. π
now what does that even mean, bestie? the data encoding of a fragment tells you the encoding of the data files that are associated with the RAW fields defined in that specific fragment. that's it. that's the tea. π
also, tiny lil detail: if a fragment has no RAW fields in it, its encoding is literally ignored. not relevant. don't worry about her. π
π RETURN VALUE π
when everything goes right, gd_encoding() returns the binary encoding of the fragment you asked about, and it's gonna be one of these symbols, periodt:
GD_UNENCODEDGD_BZIP2_ENCODEDGD_FLAC_ENCODEDGD_GZIP_ENCODEDGD_LZMA_ENCODEDGD_SIE_ENCODEDGD_SLIM_ENCODEDGD_TEXT_ENCODEDGD_ZZIP_ENCODEDGD_ZZSLIM_ENCODEDGD_ENC_UNSUPPORTED
and if the encoding scheme in the dirfile metadata is something GetData has never heard of? yeah, it's giving mystery, it's giving unknown β you get GD_ENC_UNSUPPORTED. π if you wanna know what all the other symbols actually mean and which encoding schemes are supported, go read gd_open(3) and dirfile-encoding(5). iykyk. β¨
π on error though β she returns zero, and she stashes a negative-valued error code inside theDIRFILEobject. you can grab that bad boy with a later call togd_error(3). no cap.
the possible error codes are:
GD_E_BAD_DIRFILEβ the dirfile you gave her was invalid. not it. π«GD_E_BAD_INDEXβ the index you passed was out of range. bestie. it's literally out of range. π
and if you want a cute lil descriptive error string for whatever went wrong, just call gd_error_string(3). she'll tell you the whole story. π
π HISTORY π
- the
get_encoding()function first showed up in GetData-0.5.0. iconic debut. β - then in GetData-0.7.0, she got renamed to
gd_encoding(). glow up fr fr. π
π¦ SEE ALSO π¦
gd_alter_encoding(3)gd_error(3)gd_error_string(3)gd_getdata(3)gd_open(3)dirfile(5)dirfile-encoding(5)
and that's the whole page, bestie!! π₯³ this was Version 0.10.0, dated 25 December 2016, and it's the gd_encoding(3) page from the GETDATA manual. merry christmas to whoever wrote that date, we appreciate you. go forth and check your encodings. mwah πβ¨π
π¦ where this page comes from
- debian bookworm: libgetdata-doc 0.11.0-6
- debian trixie: libgetdata-doc 0.11.0-15
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 43: getdata-devel 0.11.0-13.fc43 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- fedora 44: getdata-devel 0.11.0-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: getdata 0.11.0
- nixpkgs unstable: getdata 0.11.0
- ubuntu jammy: libgetdata-doc 0.11.0-3ubuntu1
- ubuntu noble: libgetdata-doc 0.11.0-13
- ubuntu questing: libgetdata-doc 0.11.0-15
- ubuntu resolute: libgetdata-doc 0.11.0-17build1
- ubuntu stonking: libgetdata-doc 0.11.0-17build2
- Copyright (C) 2016 D. V. Wiebe
- Copyright (C) 2008, 2009, 2010, 2012, 2016 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms