gd_alter_affixes(3)
π gd_alter_affixes β bestie edition π
okay so this is a page from the GETDATA manual, section 3, and it's literally all about gd_alter_affixes(). no cap. let's get into it π«Ά
β¨ NAME β¨
gd_alter_affixes β modify the field affixes of a fragments in a Dirfile π
(that "a fragments" is the original's grammar, not mine, i'm just the messenger π)
πΈ SYNOPSIS πΈ
#include <getdata.h>
int gd_alter_affixes(DIRFILE *dirfile, int fragment_index, const char
*prefix, const char *suffix);
π¦ DESCRIPTION π¦
so what does this icon actually DO? the gd_alter_affixes() function sets the root namespace, field prefix and suffix of fields defined in the format specification fragment given by fragment_index to prefix and suffix in the dirfile(5) database specified by dirfile. slay π
the prefix may contain a root namespace for the fragment, separated from the prefix by a dot (.). if it does not contain a namespace, the fragment's root namespace is not changed. and if you wanna remove a root namespace? you explicitly specify the null namespace via a leading dot in prefix. periodt.
the field prefix and suffix get affixed to all field codes found in the specified fragment. lowkey important: if the parent fragment to the modified fragment contains field affixes themselves, they should be included in the affixes passed to gd_alter_affixes(). yes bestie, you gotta be thorough. if prefix or suffix is NULL, the corresponding affix will be unchanged. and to remove an affix, set it to the parent fragment's corresponding affix, which may be the empty string ("").
π« it is not possible to set affixes on the root format file (i.e. fragment_index may not be zero). just... no.
the dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3). don't be out here passing random stuff, i'm begging π
β RETURN VALUE β
upon successful completion, gd_alter_affixes() returns zero. on error, it returns a negative-valued error code. possible error codes are:
GD_E_ACCMODEβ the specified dirfile was opened read-only. bestie you can't edit what you didn't open for editing πGD_E_ALLOCβ the library was unable to allocate memory.GD_E_BAD_CODEβ the suppliedprefixorsuffixcontained invalid characters. rude of you ngl.GD_E_BAD_DIRFILEβ the supplied dirfile was invalid.GD_E_BAD_INDEXβ the supplied index was out of range.GD_E_DUPLICATEβ the supplied affixes would result in one or more field codes duplicating an existing field code. we do NOT do dupes here πGD_E_PROTECTEDβ the metadata of the given fragment's parent fragment was protected from change. hands off, it's guarded π‘οΈ
the error code is also stored in the DIRFILE object and may be retrieved after this function returns by calling gd_error(3). and a descriptive error string for the error may be obtained by calling gd_error_string(3). so you'll never be left guessing, we love that for us β¨
π NOTES π
the function gd_fragment_namespace(3) can also be used to modify the root namespace. options, we love options π
π HISTORY π
the function gd_alter_affixes() appeared in GetData-0.8.0. a legend was born π
in GetData-0.10.0, the error return from this function changed from -1 to a negative-valued error code. glow up fr fr.
π SEE ALSO π
gd_error(3), gd_error_string(3), gd_fragment_affixes(3), gd_include_affix(3), gd_open(3), dirfile(5), dirfile-format(5)
okay that's the whole page bestie, every last detail preserved, nothing skipped, you're so welcome π
this was Version 0.10.0, dated 27 January 2016 β like, iconic vintage energy honestly π¦π β¨
π¦ 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, 2016, 2017 D. V. Wiebe
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms