gd_hidden(3)
π NAME π
gd_hidden β the little vibe check that tells you whether a Dirfile entry is hidden or not π
β¨ SYNOPSIS β¨
#include <getdata.h>
int gd_hidden(const DIRFILE *dirfile, const char *entry_name);
π DESCRIPTION π
okay so bestie, gd_hidden() is literally the function you call when you need to know if something's being shady and hiding from you. It queries a dirfile(5) database (the one you point at with dirfile) to figure out whether the field or alias called entry_name is hidden or not. π
And ngl, that same info is also sitting right there in the entry object provided by gd_entry(3), so like, you have options. π«Ά
By default (and this is the part that trips people up), a hidden entry does not show up in the lists returned by:
β¦including the special-case versions of gd_entry_list(3) like gd_field_list(3). π
And the way those omissions also carry over into the counts returned by the corresponding field counting function gd_nentries(3) and its special-case versions (gd_nfields(3), &c.). So yeah, if your count looks weird, check if something's hidden. Not me learning this the hard way π
π₯ RETURN VALUE π₯
Upon successful completion, gd_hidden() returns:
1if the field or alias is hidden0if the entry is not hidden
On error, it returns a negative-valued error code. β οΈ
π¨ IMPORTANT, bestie: because errors are negative and success is0or1, the caller who just checks whether the return value is non-zero is usually making an error. Like, that check is giving "I didn't read the docs" energy. Don't be that person. π
Possible error codes are:
GD_E_BAD_CODEβ The field specified by field_code was not found in the database.GD_E_BAD_DIRFILEβ The supplied dirfile was invalid.
The error code is also stored in the DIRFILE object, and you can grab it after this function returns by calling gd_error(3). Want a descriptive error string instead? Call gd_error_string(3). π
πΈ HISTORY πΈ
- The
gd_hidden()function appeared in GetData-0.8.0. - 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_entry(3), gd_field_list(3), gd_hide(3), gd_nfields(3), gd_open(3), gd_unhide(3), dirfile(5)
Version 0.10.0 Β· 25 December 2016 β yeah this page is a lil vintage but she still ate, no cap π mwah, go check your hidden entries bestie π¦
π¦ 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) 2012, 2013, 2015, 2016 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms