gd_fragment_index(3)

NAME
gd_fragment_index — retrieve the fragment containing a Dirfile field

SYNOPSIS
#include <getdata.h>

int gd_fragment_index(const DIRFILE *dirfile, const char *entry_name);

DESCRIPTION
The function queries a dirfile(5) database specified by and returns the index number of the fragment defining the field or alias named This is one of the few GetData functions which does not resolve aliases: supplying the name of an alias as will return the index of the fragment containing the alias itself and not that of its target.

RETURN VALUE
Upon successful completion, returns the requested fragment index, which is never negative. On error, returns a negative-valued error code. Possible error codes are: The entry specified by was not found in the database. 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 A descriptive error string for the error may be obtained by calling

HISTORY
The function appeared in GetData-0.5.0. In GetData-0.7.0, this function was renamed to In GetData-0.10.0, the error return from this function changed from -1 to a negative-valued error code.

SEE ALSO
dirfile(5)