gd_tell(3)
π gd_tell β GETDATA manual, but make it cute π
okay bestie, so gd_tell(3) β it's a whole GetData thing. Let's get into it. π
β¨ NAME β¨
gd_tell β reports where the I/O pointer of a Dirfile field is currently vibing π«Ά
β¨ SYNOPSIS β¨
#include <getdata.h>
off_t gd_tell(DIRFILE *dirfile, const char *field_code);
β¨ DESCRIPTION β¨
So like, gd_tell() tells you the current position of the I/O pointer of the field field_code, inside the dirfile(5) database that you passed in as dirfile. That's it, that's the whole job. π
Now here's the tea, and it's important: only RAW fields (and the implicit INDEX field) have field pointers attached to them. That's it. That's the list.
So what happens if you call gd_tell() on a derived field? Okay so it'll only report the derived field's I/O pointer position if all of its inputs are positioned the same. Like, all of them. In agreement. No drama. Otherwise? error. Straight up. π
β¨ RETURN VALUE β¨
Slay, so on a good day, gd_tell() returns a non-negative integer β that's the I/O position of your specified field, measured in samples. β¨
On a bad day, it returns a negative-valued error code. And here's the full roster of possible error codes, no cap:
GD_E_ALLOCβ the library couldn't allocate memory. it's giving out-of-ram energy πGD_E_BAD_CODEβ the field you named infield_code, or one of the fields it pulls in as input, was not found in the database. π΅οΈββοΈGD_E_BAD_DIRFILEβ thedirfileyou handed over was invalid. πGD_E_DIMENSIONβ the field you specified, or one of its inputs, wasn't of vector type.GD_E_DOMAINβ the I/O position of a derived field wasn't well defined, because its input fields were simultaneously reading from different places in the same RAW field. messy. π΅βπ«GD_E_INTERNAL_ERRORβ an internal error popped off in the library while trying to do the task. This one indicates a bug in the library. Please report the incident to the maintainer, fr fr. πGD_E_IOβ an error occurred while trying to open or read from a file on disk containing a raw field.GD_E_RECURSE_LEVELβ too many levels of recursion were encountered while trying to resolvefield_code. This usually means there's a circular dependency in the field specification in the dirfile. π (iykyk)GD_E_UNKNOWN_ENCODINGβ the encoding scheme of a RAW field could not be determined. This may also mean the binary file associated with that RAW field couldn't be found. π«GD_E_UNSUPPORTEDβ reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. Peepdirfile-encoding(5)for the details on dirfile encoding schemes. π
Also, bestie, heads up: the error code is also stored in the DIRFILE object, so you can grab it after this function returns by calling gd_error(3). And if you want a whole descriptive error string, call gd_error_string(3). π
β¨ HISTORY β¨
gd_tell()first appeared in GetData-0.8.0. iconic debut, honestly. β¨- In GetData-0.10.0, the error return from this function changed from
-1to a negative-valued error code. glow-up moment. π
β¨ SEE ALSO β¨
gd_getdata(3), gd_open(3), gd_putdata(3), gd_seek(3). go read those too, they're all part of the same friend group π«Ά
k bye bestie, that's the whole page β this was Version 0.10.0, dated 25 December 2016, and it's the gd_tell(3) GetData manual. mwah ππΈ
π¦ 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) 2011, 2014, 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