gd_array_len(3)
β¨ gd_array_len β¨
okay bestie, welcome to the GETDATA section 3 manual page for gd_array_len π
like, this is the one that tells you how long your array actually IS. no cap.
πΈ NAME πΈ
gd_array_len β returns the length of a CARRAY or SARRAY field in a Dirfile π
π¦ SYNOPSIS π¦
#include <getdata.h>
size_t gd_array_len(DIRFILE *dirfile, const char *field_code);
π DESCRIPTION π
so the gd_array_len() function goes and queries a dirfile(5) database β that's the one you pass in as dirfile β and it calculates the length of the CARRAY, CONST, STRING, or SARRAY field called field_code. that's it, that's the job. π«Ά
and listen: if field_code contains a valid representation suffix, it gets ignored. literally just ignored. it's giving "not relevant to my journey." π
the dirfile argument must point to a valid DIRFILE object that was previously created by a call to gd_open(3). no random unopened dirfiles, bestie, that's not the vibe. β¨
π RETURN VALUE π
upon successful completion (slay), gd_array_len() returns a positive integer indicating the array length of the field you specified. and btw, the length of a CONST or a STRING field is always 1 β that's just the lore. β
on error? it returns a negative-valued error code. π possible error codes are:
GD_E_BAD_CODEβ the field specified by field_code was not found in the database. bestie where is it. πGD_E_BAD_DIRFILEβ the supplied dirfile was invalid. πGD_E_BAD_FIELD_TYPEβ the field specified by field_code was not of one of the field types listed above. wrong genre of field, unfortunately. π
the error code is also stored in theDIRFILEobject, and you can retrieve it after this function returns by callinggd_error(3). and if you want a descriptive error string for the error, that'sgd_error_string(3). use your resources, bestie. π
π HISTORY π
- the
gd_carray_len()function appeared in GetData-0.7.0. it was restricted toCONSTandCARRAYentries. - in GetData-0.9.0, this function was renamed to
gd_array_len, andSTRINGentries were now valid for this function. glow up fr fr β¨ - before GetData-0.10.0, this function could also fail with the error code
GD_E_ALLOC. - in GetData-0.10.0, the error return from this function changed from
-1to a negative-valued error code. character development. π¦
π SEE ALSO π
dirfile(5), gd_open(3), gd_error(3), gd_error_string(3)
okay that's the whole page, you ate that ππ
this was Version 0.10.0, dated 25 December 2016 β yes it's an old queen and she's still iconic, periodt. πππ
π¦ 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) 2010, 2011, 2012, 2014, 2016 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms