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_fragment_index — retrieve the fragment containing a Dirfile field

Description

       The gd_fragment_index() function queries a dirfile(5) database specified by dirfile and returns the index
       number of the fragment defining the field or alias named entry_name.

       This  is  one of the few GetData functions which does not resolve aliases: supplying the name of an alias
       as entry_name will return the index of the fragment containing the alias itself and not that of its  tar‐
       get.

History

       The get_fragment_index() function appeared in GetData-0.5.0.

       In GetData-0.7.0, this function was renamed to gd_fragment_index().

       In GetData-0.10.0, the error return from this function changed from -1 to a negative-valued error code.

Name

       gd_fragment_index — retrieve the fragment containing a Dirfile field

Return Value

       Upon successful completion, gd_fragment_index() returns the requested fragment index, which is never neg‐
       ative.  On error, gd_fragment_index() returns a negative-valued error code.  Possible error codes are:

       GD_E_BAD_CODE
               The entry specified by entry_name was not found in the database.

       GD_E_BAD_DIRFILE
               The supplied dirfile was invalid.

       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_open(3),  gd_entry(3),  gd_error(3),  gd_error_string(3),  gd_fragmentname(3),  gd_parent_fragment(3),
       dirfile(5)

Version 0.10.0                                  25 December 2016                            gd_fragment_index(3)

Synopsis

#include<getdata.h>intgd_fragment_index(constDIRFILE*dirfile,constchar*entry_name);

See Also