gd_spf(3)
π gd_spf β bestie edition π
okay so you're in the gd_spf(3) page of the GETDATA manual, and honestly? it's giving "short but mighty". let's get into it π«Ά
β¨ NAME β¨
gd_spf β returns the samples per frame for a field in a dirfile πΈ
β¨ SYNOPSIS β¨
#include <getdata.h>
unsigned int gd_spf(DIRFILE *dirfile, const char *field_code);
β¨ DESCRIPTION β¨
so like, gd_spf() goes and asks a dirfile(5) database β the one you point at with dirfile β how many samples per frame the field field_code has. that's it. that's the whole job. π
fun fact tho: this same info is also available from gd_entry(3), so if you're already hanging out over there you don't gotta double-dip. iykyk.
and bestie, real talk: the dirfile argument must point to a valid DIRFILE object that you made earlier with a call to gd_open(3). no fake ones, no half-baked ones. it's gotta be the real deal or nothing. π
β¨ RETURN VALUE β¨
when it works? it's a positive integer, periodt β the number of samples per frame for the field you asked about. slay. π
when it doesn't work? it returns zero and stashes a negative-valued error code in the DIRFILE object, which you can scoop up later with gd_error(3). the possible error codes are:
GD_E_BAD_CODEβ the field you named in field_code? not found in the database. it's not there. it never was. πGD_E_BAD_DIRFILEβ the dirfile you handed over was invalid. red flag, block them.GD_E_DIMENSIONβ a scalar field showed up where a vector field was expected. awkward!! wrong vibe entirely. πGD_E_INTERNAL_ERRORβ something broke inside the library while it was doing the task. this means there's a bug in the library, and you should please report the incident to the maintainer. not your fault, fr fr. πGD_E_RECURSE_LEVELβ too many levels of recursion got hit while trying to resolve field_code. usually this means there's a circular dependency in the field specification in the dirfile. it's a loop. it's always been a loop. π₯
and if you want an actual human-readable description of whatever went wrong, hit up gd_error_string(3) β it'll spill the whole story. π¦
β¨ HISTORY β¨
the lore, bestie, is important:
get_spf()first appeared way back in GetData-0.3.0 β vintage.- in GetData-0.7.0 it got renamed to
gd_spf(). glow-up era. β¨ - in GetData-0.10.0 the error return changed from
-1to a negative-valued error code. she evolved. π
β¨ SEE ALSO β¨
gd_entry(3), gd_error(3), gd_error_string(3), gd_open(3), dirfile(5)
and that's the whole page, bestie β this was Version 0.10.0, dated 25 December 2016. a lil holiday gift from the GETDATA girlies ππ go forth and count your samples per frame, you absolute icon β
π¦ 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, 2011, 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