1get_spf(3) GETDATA get_spf(3)
2
3
4
6 get_spf — returns the samples per frame for a field in a dirfile
7
9 #include <getdata.h>
10
11 gd_spf_t get_spf(DIRFILE *dirfile, const char *field_code);
12
14 The get_spf() function queries a dirfile(5) database specified by
15 dirfile and returns the number of samples per frame for the field
16 field_code. If field_code contains a valid representation suffix, it
17 will be ignored. The gd_spf_t type is an unsigned 16-bit integer type.
18
19 The dirfile argument must point to a valid DIRFILE object previously
20 created by a call to dirfile_open(3).
21
22
24 Upon successful completion, get_spf() returns the number of samples per
25 frame for the field specified. On error, it returns zero and sets the
26 dirfile error to a non-zero error value. Possible error values are:
27
28 GD_E_BAD_CODE
29 The field specified by field_code was not found in the data‐
30 base.
31
32 GD_E_BAD_DIRFILE
33 The supplied dirfile was invalid.
34
35 GD_E_BAD_REPR
36 The representation suffix specified in field_code was not
37 recognised.
38
39 GD_E_INTERNAL_ERROR
40 An internal error occurred in the library while trying to per‐
41 form the task. This indicates a bug in the library. Please
42 report the incident to the maintainer.
43
44 GD_E_RECURSE_LEVEL
45 Too many levels of recursion were encountered while trying to
46 resolve field_code. This usually indicates a circular depen‐
47 dency in field specification in the dirfile.
48
49 The dirfile error may be retrieved by calling get_error(3). A descrip‐
50 tive error string for the last error encountered can be obtained from a
51 call to get_error_string(3).
52
54 dirfile(5), dirfile_open(3), getdata(3), get_error(3), get_er‐
55 ror_string(3)
56
57
58
59Version 0.6.1 9 February 2010 get_spf(3)