gd_spf3
Returns the samples per frame for a field in a dirfile
Usage
#include <getdata.h>
unsigned int gd_spf(DIRFILE *dirfile, const char *field_code);
Overview
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).
Return value
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:
.TP 8 GD_E_BAD_CODE The field specified by field_code was not found in the database.
.TP 8 GD_E_BAD_DIRFILE The supplied dirfile was invalid.
.TP 8 GD_E_DIMENSION A scalar field was found where a vector field was expected.
.TP 8 GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer.
.TP 8 GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve field_code. This usually indicates a circular dependency in field specification in the dirfile.
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.