gd_fragment_index3
Retrieve the fragment containing a dirfile field
Usage
#include <getdata.h>
int gd_fragment_index(const DIRFILE *dirfile, const char *entry_name);
Overview
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 target.
Return value
Upon successful completion, gd_fragment_index() returns the requested fragment index, which is never negative. On error, gd_fragment_index() returns a negative-valued error code. Possible error codes are:
.TP 8 GD_E_BAD_CODE The entry specified by entry_name was not found in the database.
.TP 8 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).
Releases
7 releases since Debian 7 (Wheezy); the text changed 2 times.