gd_alter_spec(3)
β¨ gd_alter_spec β¨
okay bestie, this is the gd_alter_spec(3) page from the GETDATA manual, and it's giving "let me change my mind about this field" energy. come sit, we're gonna read it together π
πΈ NAME πΈ
gd_alter_spec, gd_malter_spec β modify a field in a Dirfile
π¦ SYNOPSIS π¦
#include <getdata.h>
int gd_alter_spec(DIRFILE *dirfile, const char *line, int recode);
int gd_malter_spec(DIRFILE *dirfile, const char *line, const char
*parent, int recode);
π DESCRIPTION π
so. gd_alter_spec() takes the field described by the field specification line in line and modifies it, in the dirfile that dirfile points at. iconic behavior, honestly.
gd_malter_spec() is basically the same girl but with a plot twist: it modifies the metafield under the field indicated by the field code parent. also, field specification lines are described in detail in dirfile-format(5), so if you need the lore, that's where it lives π
The name of the field you're modifying must already exist, and it gets pulled straight out of the field specification line. heads up: when you're adding a metafield, line should only contain a field specification β do not put a /META directive in there. not the vibe. π
If the field you modified is of type RAW and the recode argument is non-zero, the binary file associated with the field gets converted for changes in data type and samples-per-frame. when that happens, the field's I/O pointer gets reset to the beginning-of-frame. (yes, we're rewinding. main character reset moment.) if recode is zero, no binary file conversion happens at all, periodt.
If the modified field is of type LINTERP and recode is non-zero, the look-up table file will be moved if line specifies a different path β and it will overwrite an existing file with the new pathname, if present. so, like, be aware π if the field specified by field_code is of type other than RAW or LINTERP, then recode is just ignored entirely. it's not even being looked at. it's fine.
β οΈ real talk: if you pass these functions a directive line instead of a field specification line, you get a syntax error. full stop. and these functions never call the registered parser callback function β not even if line contains a syntax error. so don't count on that callback to save you, bestie, it's not coming.
β RETURN VALUE β
On success, gd_alter_spec() and gd_malter_spec() return zero. π On error, it returns a negative-valued error code. Possible error codes are:
GD_E_ACCMODEβ the specified dirfile was opened read-only. (can't touch this, literally.)GD_E_ALLOCβ the library was unable to allocate memory. πGD_E_BAD_CODEβ the field specified inlinewas not found, or theparentfield code was not found.GD_E_BAD_DIRFILEβ the supplied dirfile was invalid.GD_E_FORMATβ a syntax error was encountered inline.GD_E_IOβ an I/O error occurred while translating the binary file associated with a modifiedRAWfield, or an I/O error occurred while attempting to rename aLINTERPtable file.GD_E_LINE_TOO_LONGβ the suppliedlinewas longer than the parser was able to deal with. line lengths are limited by the storage size ofsize_t.GD_E_PROTECTEDβ the metadata of the fragment was protected from change. or, a request to translate the binary file associated with aRAWfield was attempted, but the data of the fragment was protected.GD_E_UNKNOWN_ENCODINGβ the encoding scheme of the indicated format specification fragment is not known to the library. as a result, the library was unable to translate the binary file be associated with a modifiedRAWfield.GD_E_UNSUPPORTEDβ the encoding scheme of the indicated format specification fragment does not support translating the empty binary file associated with a modifiedRAWfield.
The error code is also stored in the DIRFILE object, and you can retrieve it after this function returns by calling gd_error(3). want a descriptive error string instead? call gd_error_string(3). π«Ά
π HISTORY π
The functions dirfile_alter_spec() and dirfile_malter_spec() appeared in GetData-0.5.0. throwback era.
In GetData-0.7.0, these functions were renamed to gd_alter_spec() and gd_malter_spec.() β glow-up arc complete β¨
In GetData-0.10.0, the error return from these functions changed from -1 to a negative-valued error code. glow-up part two.
π SEE ALSO π
Any of the gd_alter_<entry-type> functions (e.g., gd_alter_bit(3)), gd_alter_spec(3), gd_error(3), gd_error_string(3), gd_metaflush(3), gd_open(3), dirfile-format(5)
Version 0.10.0 β 25 December 2016 π that's the version and the date, bestie, noted and archived. this has been gd_alter_spec(3), go forth and modify responsibly π
π¦ 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) 2008, 2010, 2011, 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