gd_linterp_tablename(3)
gd_linterp_tablename π
okay bestie so this is a page from the GETDATA manual, section 3 (that's the library-functions girlies). It's called gd_linterp_tablename and it's here to retrieve the pathname of a look-up table in a Dirfile. Yes, a whole function for that. She's specific. She's iconic. Let's go π
β¨ NAME β¨
gd_linterp_tablename β bestie, she retrieves the pathname of a look-up table in a Dirfile. That's the whole job. She does one thing and she does it flawlessly π
πΈ SYNOPSIS πΈ
#include <getdata.h>
char *gd_linterp_tablename(DIRFILE *dirfile, const char *field_code);
Two arguments, one char * back. Clean. Minimal. Ate. π₯
π¦ DESCRIPTION π¦
So here's the tea, fr fr: gd_linterp_tablename() goes and gets you the pathname of the look-up table (LUT, for short, iykyk) that's being used by the LINTERP field you name in field_code, living inside the dirfile you handed over as dirfile.
And like β if field_code happens to contain a valid representation suffix? It gets ignored. Not a problem, not an error, just ignored. She moves on. Periodt.
Note, bestie, this one matters: this function returns a fully canonicalised, absolute path. Meanwhile the value of thetablemember in agd_entry_tobject (go seegd_entry(3)for that whole situation) is the path which appears in the format specification on disk, which may be a path relative to the fragment directory. So they are NOT the same thing and you cannot be out here treating them like they are. Okay? Okay π«Ά
π RETURN VALUE π
On success, gd_linterp_tablename() returns the full pathname of the LUT associated with the specified field β and she returns it in a newly-allocated buffer. Brand new. Fresh out the box. π
By default that buffer is allocated with malloc(3), but you can specify a different memory manager by calling gd_alloc_funcs(3) before you call this function. Timing is everything, bestie. And listen: the caller is responsible for deallocating the returned buffer. That's you. You're the caller. Free your memory, it's self-care π§
On error, this function returns NULL and stores a negative-valued error code in the DIRFILE object, which you can retrieve with a subsequent call to gd_error(3). Possible error codes are:
GD_E_ALLOCβ the library was unable to allocate memory. She tried, she really did πGD_E_BAD_CODEβ the field specified byfield_codewas not found. Doesn't exist. Not in this house πGD_E_BAD_DIRFILEβ the supplied dirfile was invalid. Something's off with her πGD_E_BAD_FIELD_TYPEβ the field specified byfield_codewas not aLINTERPfield. Wrong vibe check, wrong field type, sorry π
And if you want an actual descriptive error string for whatever went wrong β like, words, not just a number β call gd_error_string(3). She'll tell you what happened in full sentences π
β HISTORY β
The gd_linterp_tablename() function appeared in GetData-0.8.1. Baby's been around. Respect the elders π
π SEE ALSO π
That's the whole page, bestie β go forth and canonicalise those paths π
This lil masterclass comes to you courtesy of Version 0.10.0, dated 25 December 2016, filed under gd_linterp_tablename(3) in the GETDATA manual. Merry everything, slay, bye πβ¨
π¦ 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