gd_nfragments(3)
π gd_nfragments β bestie edition π
okay so you're here for gd_nfragments(3), a little function from the GETDATA manual, and honestly? she's a queen. sit down, grab a strawberry π, and let me tell you about her.
β¨ NAME β¨
gd_nfragments β retrieve the number of format specification fragments in a dirfile π¦
β¨ SYNOPSIS β¨
#include <getdata.h>
int gd_nfragments(const DIRFILE *dirfile);
β¨ DESCRIPTION β¨
so the way that gd_nfragments() works is: you hand her a dirfile(5) database β that's the one your dirfile argument points at β and she counts up the total number of parsed format specification fragments in that database and gives you that number back. that's it. that's the whole job. iconic honestly π
one thing though, bestie, don't skip this part: your dirfile argument has to point to a valid DIRFILE object, and that object needs to have been made earlier by a call to gd_open(3). no fake ones, no homemade ones. she'll know. π
β¨ RETURN VALUE β¨
when everything goes right, gd_nfragments() returns the total number of format specification fragments present in the dirfile. slay. β¨
but on error? π she returns zero and tucks a negative-valued error code into the DIRFILE object, and you can go fish it back out later with a follow-up call to gd_error(3). the possible error codes are:
GD_E_BAD_DIRFILEβ the supplied dirfile was invalid. that's it, that's the one. π
and if you want an actual human-readable explanation of what went wrong, hit up gd_error_string(3) for a descriptive error string. she'll tell you the whole story. π«Ά
β¨ HISTORY β¨
a lil glow-up timeline for you π:
- the
get_nfragments()function first appeared in GetData-0.4.0. - then in GetData-0.7.0 she got renamed to
gd_nfragments(). rebrand era. main character energy fr fr. π
β¨ SEE ALSO β¨
go read these too, i'm obsessed with them:
Version 0.10.0 πΈ 25 December 2016 π and that's the whole page, bestie β go count some fragments, you've got this, no cap. πππ¦
π¦ 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