1
2
3
4
5
6
7
8
9gd_nframes(3) GETDATA gd_nframes(3)
10
11
12
14 gd_nframes — report the size of a Dirfile
15
16
18 #include <getdata.h>
19
20 off_t gd_nframes(DIRFILE *dirfile);
21
22
24 The gd_nframes() function queries a dirfile(5) database specified by
25 dirfile and returns the number of frames in the database. Since dif‐
26 ferent fields may have differing number of frames, the Dirfile Stan‐
27 dards (see dirfile(5)) dictate that the number of frames in the data‐
28 base is defined to be equal to the number of frames in the reference
29 field defined by the /REFERENCE directive (see dirfile-format(5)) or,
30 if no such reference field is defined, by the first raw field specified
31 in the format specification.
32
33 If no vector fields are defined in the database, gd_nframes() returns
34 zero and succeeds.
35
36 The dirfile argument must point to a valid DIRFILE object previously
37 created by a call to gd_open(3).
38
39
41 Upon successful completion, gd_nframes() returns the number of frames
42 in the dirfile, which is never negative. On error, it returns a nega‐
43 tive-valued error code. Possible error codes are:
44
45 GD_E_ALLOC
46 The library was unable to allocate memory.
47
48 GD_E_BAD_DIRFILE
49 The supplied dirfile was invalid.
50
51 GD_E_IO An I/O error occurred while determining the number of samples
52 in the data file associated with the reference field.
53
54 GD_E_UNKNOWN_ENCODING
55 The number of samples available for the reference field could
56 not be determined because the encoding used to store the refer‐
57 ence field's data file was not understood.
58
59 GD_E_UNSUPPORTED
60 GetData does not support determining the number of samples for
61 the encoding of of the data file associated with the reference
62 field.
63
64 The error code is also stored in the DIRFILE object and may be re‐
65 trieved after this function returns by calling gd_error(3). A descrip‐
66 tive error string for the error may be obtained by calling
67 gd_error_string(3).
68
69
71 The get_nframes() function appeared in GetData-0.3.0.
72
73 In GeData-0.7.0, this function was renamed to gd_nframes().
74
75
77 dirfile(5), dirfile-encoding(5), gd_open(3), gd_bof(3), gd_eof(3),
78 gd_error(3), gd_error_string(3)
79
80
81
82Version 0.10.0 25 December 2016 gd_nframes(3)