logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

gd_add_alias, gd_madd_alias — add a field to a Dirfile

Description

       The  gd_add_alias()  function adds the alias named alias_name pointing to target_code to the fragment in‐
       dexed by fragment_index in the dirfile specified by dirfile.  The gd_madd_alias() function behaves  simi‐
       larly, but adds the field as a meta-entry under the field indicated by the field code parent.

History

       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.

Name

       gd_add_alias, gd_madd_alias — add a field to a Dirfile

Return Value

       On  success,  gd_add_alias() and gd_madd_alias() return zero.   On error, a negative-valued error code is
       returned.  Possible error codes are:

       GD_E_ACCMODE
               The specified dirfile was opened read-only.

       GD_E_ALLOC
               The library was unable to allocate memory.

       GD_E_BAD_CODE
               Either the alias_name was invalid: containing an invalid  character  or  lacking  the  containing
               fragment's  namespace  or  affixes, or else the parent field code was not found, or was already a
               metafield.

       GD_E_BAD_DIRFILE
               The supplied dirfile was invalid.

       GD_E_BAD_INDEX
               The fragment_index specified was out of range.

       GD_E_DUPLICATE
               The alias_name parameter duplicated that of an already existing entry.

       GD_E_PROTECTED
               The metadata of the fragment was protected from change.  Or, the creation of a RAW field was  at‐
               tempted and the data of the fragment was protected.

       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).

See Also

gd_add(3), gd_alias_target(3), gd_entry(3), gd_madd(3), gd_metaflush(3), gd_open(3), dirfile-format(5)

Version 0.10.0                                  25 December 2016                                 gd_add_alias(3)

Synopsis

#include<getdata.h>intgd_add_alias(DIRFILE*dirfile,constchar*alias_name,constchar*target_code,intfragment_index);intgd_madd_alias(DIRFILE*dirfile,constchar*parent,constchar*alias_name,constchar*target_code);

See Also