gd_nframes(3)

NAME
gd_nframes — report the size of a Dirfile

SYNOPSIS
#include <getdata.h>

off_t gd_nframes(DIRFILE *dirfile);

DESCRIPTION
The function queries a dirfile(5) database specified by and returns the number of frames in the database. Since different fields may have differing number of frames, the Dirfile Standards (see dirfile(5)) dictate that the number of frames in the database is defined to be equal to the number of frames in the reference field defined by the /REFERENCE directive (see dirfile-format(5)) or, if no such reference field is defined, by the first raw field specified in the format specification.

If no vector fields are defined in the database, returns zero and succeeds.

The argument must point to a valid DIRFILE object previously created by a call to

RETURN VALUE
Upon successful completion, returns the number of frames in the dirfile, which is never negative. On error, it returns a negative-valued error code. Possible error codes are: The library was unable to allocate memory. The supplied dirfile was invalid. An I/O error occurred while determining the number of samples in the data file associated with the reference field. The number of samples available for the reference field could not be determined because the encoding used to store the reference field's data file was not understood. GetData does not support determining the number of samples for the encoding of of the data file associated with the reference field.

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.3.0.

In GeData-0.7.0, this function was renamed to

SEE ALSO
dirfile(5), dirfile-encoding(5),