1
2
3
4
5
6
7
8
9gd_eof(3) GETDATA gd_eof(3)
10
11
12
14 gd_eof — find the end of a Dirfile field
15
16
18 #include <getdata.h>
19
20 off_t gd_eof(DIRFILE *dirfile, const char *field_code);
21
22
24 The gd_eof() function queries a dirfile(5) database specified by
25 dirfile and determines the sample number of the end-of-field marker for
26 the vector field given by field_code. This is effectively the total
27 number of samples available for the field, including any frame offset.
28
29 The caller should not assume that this is equivalent (when accounting
30 for the samples-per-frame of the indicated field) to the number of
31 frames in the database returned by gd_nframes(3), nor even that the
32 end-of-field marker falls on a frame boundary.
33
34 For a RAW field, the end-of-field marker occurs immediately after the
35 last datum in the data file associated with the field. The special
36 field INDEX has no end-of-field marker.
37
38 The end-of-field of a PHASE field is the end-of-field of its input ad‐
39 justed by the PHASE field's shift. For other vector field types, the
40 end-of-field marker is the smallest end-of-field marker of any of its
41 inputs.
42
43 If the end-of-field marker for a field is less than or equal to its be‐
44 ginning-of-field marker (see gd_bof(3)), then that field has no data.
45 For a RAW field, the difference between the beginning- and end-of-field
46 markers indicates the number of samples of data actually stored on
47 disk.
48
49 The dirfile argument must point to a valid DIRFILE object previously
50 created by a call to gd_open(3).
51
52
54 Upon successful completion, gd_eof() returns the sample number of the
55 end-of-field marker for the indicated field, which is never negative.
56 On error, it returns a negative-valued error code. Possible error
57 codes are:
58
59 GD_E_ALLOC
60 The library was unable to allocate memory.
61
62 GD_E_BAD_CODE
63 The field specified by field_code or one of the fields it uses
64 as input was not found in the database.
65
66 GD_E_BAD_DIRFILE
67 The supplied dirfile was invalid.
68
69 GD_E_BAD_FIELD_TYPE
70 The location of the non-existent end-of-field marker for the
71 special field INDEX was requested, possibly as a result of the
72 field specified by field_code using INDEX as one of its inputs.
73
74 GD_E_DIMENSION
75 A scalar field was found where a vector field was expected in
76 the definition of field_code or one of its inputs, or else
77 field_code itself specified a scalar field.
78
79 GD_E_INTERNAL_ERROR
80 An internal error occurred in the library while trying to per‐
81 form the task. This indicates a bug in the library. Please
82 report the incident to the GetData developers.
83
84 GD_E_IO An I/O error occurred while deterimining the size of the raw
85 data file associated with the field, or one of its input
86 fields.
87
88 GD_E_RECURSE_LEVEL
89 Too many levels of recursion were encountered while trying to
90 resolve field_code. This usually indicates a circular depen‐
91 dency in field specification in the dirfile.
92
93 GD_E_UNKNOWN_ENCODING
94 The size of the decoded data file associated with the specified
95 field or one of its inputs could not be determined, because its
96 encoding scheme was not understood.
97
98 GD_E_UNSUPPORTED
99 The size of the decoded data file associated with the specified
100 field or one of its inputs could not be determined, because its
101 encoding scheme was not supported.
102
103 The error code is also stored in the DIRFILE object and may be re‐
104 trieved after this function returns by calling gd_error(3). A descrip‐
105 tive error string for the error may be obtained by calling
106 gd_error_string(3).
107
108
110 The gd_eof() function appeared in GetData-0.7.0.
111
112 In GetData-0.10.0, the error return from this function changed from -1
113 to a negative-valued error code.
114
115
117 gd_bof(3), gd_error(3), gd_error_string(3), gd_nframes(3), gd_open(3),
118 dirfile(5), dirfile-encoding(5)
119
120
121
122Version 0.10.0 25 December 2016 gd_eof(3)