int gd_add_alias(DIRFILE *dirfile, const char *alias_name,
const char *target_code, int fragment_index);
- int gd_madd_alias(DIRFILE *dirfile, const char *parent, const char *alias_name, const char *target_code);
RETURN VALUEOn success, gd_add_alias() and gd_madd_alias() return zero. On error, -1 is returned and the dirfile error is set 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 alias_name contained invalid characters; or it or an input field did not contain the affected fragment's prefix or suffix. Alternately, the parent field code was not found, or was already a metafield.
- The supplied dirfile was invalid.
- The fragment_index specified was out of range.
- The alias_name parameter duplicated that of an already existing entry.
- The metadata of the fragment was protected from change. Or, the creation of a RAW field was attempted and the data of the fragment was protected.