gd_uninclude(3)
π gd_uninclude π
okay bestie, welcome to GETDATA section 3, and today's main character is gd_uninclude β the girl whose whole job is removing a format specification fragment from a Dirfile. yes, she's the one who shows up with the trash bag. no cap. ποΈβ¨
πΈ NAME πΈ
gd_uninclude β remove a format specification fragment from a Dirfile π¦
β¨ SYNOPSIS β¨
#include <getdata.h>
int gd_uninclude(DIRFILE *dirfile, int fragment_index, int del);
π DESCRIPTION π
so like, gd_uninclude() takes the format specification fragment at fragment_index out of the dirfile you gave her. and not just that one β she also takes out any fragments that the indicated fragment INCLUDEs. it's giving "you and your whole friend group are uninvited." π
any fields defined in the removed fragments? gone. removed from the dirfile. bye. π
before she removes anything, all the pending writes get flushed to the RAW fields defined in the fragments she's about to remove. so nothing's left hanging, periodt.
- if
delis zero, metadata changes also get written to the removed fragments. - if
delis non-zero, the format specification fragments get deleted from disk, if possible. (key phrase: if possible π« )
but listen β regardless of what del is, the binary data files associated with RAW fields defined in the removed fragments are NOT deleted. she will not touch them. absolutely not her job.
if you actually want those binary files gone, call gd_delete(3) before you call this function. that's the move. π
and the big one: the primary format specification (the fragment indexed by zero) cannot be removed from the dirfile. she's the main character. she stays. π
π₯ RETURN VALUE π₯
slay = success = gd_uninclude() returns zero. π
if something goes wrong, you get a negative-valued error code. the possible ones are:
GD_E_ACCMODEβ the dirfile you handed her was opened in read-only mode. bestie cannot write. πGD_E_ALLOCβ the library could not allocate memory. it's giving broke. πGD_E_BAD_DIRFILEβ the dirfile you supplied was invalid.GD_E_BAD_INDEXβ the fragment index you gave was out of range, or you tried to remove the primary format specification. (we said she can't leave!! π)GD_E_IOβ an I/O error happened while trying to write modified data or metadata to disk.GD_E_PROTECTEDβ the metadata of the fragment that included the removed fragment was protected from change. π
the error code also gets stashed in the DIRFILE object, so you can go get it after this function returns by calling gd_error(3). and if you want an actual descriptive error string? call gd_error_string(3). π
π§ NOTES π§
this function re-arranges the remaining format specification fragments in some unspecified way β except for the primary fragment, which is guaranteed to stay at index zero. she is anchored. β
so if you're a caller who caches format specification fragment indices: re-initialise your cache after calling this function. don't be out here trusting stale indices, i'm begging you. π
π HISTORY π
dirfile_uninclude()appeared in GetData-0.5.0. the og name. vintage. π°οΈ- in GetData-0.7.0, this function was renamed to
gd_uninclude(). - in GetData-0.10.0, the error return from this function changed from
-1to a negative-valued error code. glow-up fr fr. β¨
π«Ά SEE ALSO π«Ά
gd_delete(3), gd_include(3), gd_open(3), gd_error(3), gd_error_string(3), gd_fragmentname(3), gd_nfragments(3), gd_reference(3), dirfile(5), dirfile-encoding(5), dirfile-format(5)
that's the whole page babes π this was Version 0.10.0, dated 25 December 2016 β a lil christmas gift of documentation from the GetData girlies. go forth, uninclude responsibly, and remember: primary fragment stays at index zero, always and forever. periodt. ππ π¦
π¦ 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, 2010, 2014, 2016 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms