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_fragmentname — retrieve a Dirfile format specification fragment name

Description

       The  gd_fragmentname()  function queries a dirfile(5) database specified by dirfile and returns the file‐
       name of the format specification fragment indexed by the non-negative index.

       The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).

       The fragment with index equal to zero is always the primary fragment for the database  (the  file  called
       format  in the root dirfile directory).  The largest valid value of index is one less than the total num‐
       ber of fragments, which may be obtained from a call to gd_nfragments(3).

History

       The get_fragmentname() function appeared in GetData-0.4.0.

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

Name

       gd_fragmentname — retrieve a Dirfile format specification fragment name

Return Value

       Upon successful completion, gd_fragmentname() returns a pointer to a read-only character string  contain‐
       ing the file name of the specified fragment.

       On  error, this function returns NULL and stores a negative-valued error code in the DIRFILE object which
       may be retrieved by a subsequent call to gd_error(3).  Possible error codes are:

       GD_E_BAD_DIRFILE
               The supplied dirfile was invalid.

       GD_E_BAD_INDEX
               The supplied index was out of range.

       A descriptive error string for the error may be obtained by calling gd_error_string(3).

See Also

dirfile(5),    gd_error(3),    gd_error_string(3),    gd_include(3),    gd_nfragments(3),     gd_open(3),
       gd_parent_fragment(3)

Version 0.10.0                                  25 December 2016                              gd_fragmentname(3)

Synopsis

#include<getdata.h>constchar*gd_fragmentname(constDIRFILE*dirfile,intindex);

See Also