gd_fragmentname(3)
π gd_fragmentname β bestie edition β¨
ok so this is the GETDATA manual page for gd_fragmentname(3) and she is iconic β she gets you the name of a Dirfile format specification fragment and honestly? she serves. let's go π¦
πΈ NAME πΈ
gd_fragmentname β retrieve a Dirfile format specification fragment name π
β¨ SYNOPSIS β¨
#include <getdata.h>
const char* gd_fragmentname(const DIRFILE *dirfile, int index);
π DESCRIPTION π
okay so the gd_fragmentname() function queries a dirfile(5) database that you pass in as dirfile, and it hands you back the filename of the format specification fragment indexed by the non-negative index. no cap. π
the dirfile argument has to point to a valid DIRFILE object β and it has to be one you already created by calling gd_open(3). no random objects, bestie, she's picky π«Ά
here's the tea about indexing: the fragment with index equal to zero is always the primary fragment for the database β that's the file called format in the root dirfile directory. iconic, always first, main character energy π
and the largest valid value of index is one less than the total number of fragments. how do you find the total? call gd_nfragments(3), obviously π
π₯ RETURN VALUE π₯
when everything goes right? she returns a pointer to a read-only character string containing the file name of the specified fragment. slay. β¨
but when things go wrong π she returns NULL and stashes a negative-valued error code in the DIRFILE object, which you can grab later with gd_error(3). the possible error codes are:
GD_E_BAD_DIRFILEβ the dirfile you gave her was invalid. rude, but fair πGD_E_BAD_INDEXβ the index you gave her was out of range. bestie. girl. check your bounds π
if you want a descriptive error string for whatever went wrong, call gd_error_string(3) and she'll tell you all about it πΈ
π HISTORY π
- the
get_fragmentname()function showed up in GetData-0.4.0 β vintage, lowkey a classic π - then in GetData-0.7.0 this function got renamed to
gd_fragmentname(). glow-up fr fr β
π«Ά SEE ALSO π«Ά
dirfile(5), gd_error(3), gd_error_string(3), gd_include(3), gd_nfragments(3), gd_open(3), gd_parent_fragment(3)
go read them, iykyk π
and that's the whole page, no notes π this was Version 0.10.0, dated 25 December 2016, and it's gd_fragmentname(3) forever and always π§π
π¦ 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, 2016 D.V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms