gd_add_alias, gd_madd_alias—add a field to a Dirfile
#include <getdata.h>
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);
The gd_add_alias() function adds the alias named alias_name pointing to target_code to the fragment indexed by fragment_index in the dirfile specified by dirfile. The gd_madd_alias() function behaves similarly, but adds the field as a meta-entry under the field indicated by the field code parent.
On success, gd_add_alias() and gd_madd_alias() return zero. On error, a negative-valued error code is returned. Possible error codes are:
The error code is also stored in the DIRFILE object and may be retrieved after this function returns by calling gd_error(3). A descriptive error string for the error may be obtained by calling gd_error_string(3).
The functions gd_add_alias() and gd_madd_alias() appeared in GetData-0.8.0.
In GetData-0.10.0, the error return from these functions changed from −1 to a negative-valued error code.
gd_add(3), gd_alias_target(3), gd_entry(3), gd_madd(3), gd_metaflush(3), gd_open(3), dirfile-format(5)