- int gd_alter_affixes(DIRFILE *dirfile, int fragment_index, const char *prefix, const char *suffix);
The field prefix and suffix are appended to all field codes found in the specified fragment. If the parent fragment to the modified fragment contains field affixes themselves, they should be included in the affixes passed to gd_alter_affixes(). See EXAMPLES below for further details. If prefix or suffix is NULL, the corresponding affix will be unchanged. 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).
The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).
RETURN VALUEUpon successful completion, gd_alter_affixes() returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are:
- The specified dirfile was opened read-only.
- The library was unable to allocate memory.
- The supplied prefix or suffix contained invalid characters.
- The supplied dirfile was invalid.
- The supplied index was out of range.
- The supplied affixes would result in one or more field codes duplicating an existing field code.
- The metadata of the given fragment's parent fragment was protected from change.