gd_spf—returns the samples per frame for a field in a dirfile
#include <getdata.h>
unsigned int gd_spf(DIRFILE *dirfile, const char *field_code);
The gd_spf() function queries a dirfile(5) database specified by dirfile and determines the number of samples per frame for the field field_code. This information is also available from gd_entry(3).
The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).
Upon successful completion, gd_spf() returns a positive integer indicating the number of samples per frame for the field specified. On error, it returns zero 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:
A descriptive error string for the error may be obtained by calling gd_error_string(3).
The get_spf() function appeared in GetData-0.3.0.
In GetData-0.7.0, this function was renamed to gd_spf().
In GetData-0.10.0, the error return from this function changed from −1 to a negative-valued error code.
gd_entry(3), gd_error(3), gd_error_string(3), gd_open(3), dirfile(5)