gd_fragment_affixes man page

gd_fragment_affixes — report the field affixes of a fragment of a dirfile database

Synopsis

#include <getdata.h>

int gd_fragment_affixes(DIRFILE *dirfile, int fragment_index, char **prefix, char **suffix);

Description

The gd_fragment_affixes() function queries a dirfile(5) database specified by dirfile and returns the field affixes for the fragment indexed by fragment_index. The field prefix and suffix are appended to all field codes found in the specified fragment.

The prefix and suffix parameters point to memory locations in which store the addresses of the returned strings.

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

Return Value

Upon successful completion, gd_fragment_affixes() returns zero. If non-empty, the prefix and suffix are reported in malloc(3)'d buffers whose addresses are returned in *prefix and *suffix. They should be deallocated by the caller when no longer needed by calling free(3). If the fragment prefix or suffix is the empty string, NULL is returned in the corresponding pointer.

On error, -1 is returned and sets the dirfile error to a non-zero error value. In this case, the values of *prefix and *suffix are unspecified, but will NOT be pointers to valid allocated memory. Possible dirfile error values are:

GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
GD_E_BAD_INDEX
The supplied index was out of range.

The dirfile error may be retrieved by calling gd_error(3). A descriptive error string for the last error encountered can be obtained from a call to gd_error_string(3).

See Also

gd_alter_frameoffset(3), gd_include_affixes(3), gd_open(3), dirfile(5), dirfile-format(5)

Referenced By

gd_alter_affixes(3).

4 November 2015 Version 0.9.1 GETDATA