gd_naliases(3)
π gd_naliases π
okay bestie, so this one lives in the GETDATA manual, section 3 (that's the library-functions section, iykyk). And no, it's not a typo β that "n" in gd_naliases is literally the whole point, it's the number of aliases. lowercase n, huge vibes. π
β¨ NAME β¨
gd_naliases β report the number of aliases of a field in a Dirfile π
β¨ SYNOPSIS β¨
#include <getdata.h>
unsigned int gd_naliases(DIRFILE *dirfile, const char *field_code);
β¨ DESCRIPTION β¨
okay so picture this: gd_naliases() looks up a dirfile(5) database β the one you point at with dirfile β and then it counts how many aliases belong to the entry you named in field_code. π§
and not to be dramatic but it counts the entry's own name too. like, the original name is absolutely included in the total. it's part of the squad. periodt. π
about that dirfile argument: it must point to a valid DIRFILE object, and it has to be one you already made by calling gd_open(3) earlier. no hand-crafting one at home, bestie, that's not the move. π
β¨ RETURN VALUE β¨
when everything goes right, gd_naliases() hands you back an unsigned int β that's the number of aliases of the field code you asked about, over in that dirfile. and if it worked? that count is at least one. always. minimum one. because again, the entry's own name counts. π
now the sad part π β on error, this function returns zero and stashes a negative-valued error code inside the DIRFILE object. you can go get that code later with a follow-up call to gd_error(3). the possible error codes are:
GD_E_BAD_CODEβ the field code you passed in wasn't found in the database. gone. ghosted. πGD_E_BAD_DIRFILEβ the dirfile you gave it was invalid. not it. π«
and if you want an actual descriptive error string (like, words, not just a number), hit up gd_error_string(3). she'll tell you what happened. π«Ά
β¨ HISTORY β¨
gd_naliases() made its grand entrance in GetData-0.8.0. main character debut, honestly. π
β¨ SEE ALSO β¨
and that's the whole page, bestie β this one's from Version 0.10.0, dated 25 December 2016. happy birthday to her, she's been slaying since 0.8.0 πβ¨ππ¦πΈ no cap, go count some aliases.
π¦ 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, 2016 D.V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms