1
2
3
4
5
6
7
8
9gd_tell(3) GETDATA gd_tell(3)
10
11
12
14 gd_tell — report the position of a Dirfile field I/O pointer
15
16
18 #include <getdata.h>
19
20 off_t gd_tell(DIRFILE *dirfile, const char *field_code);
21
22
24 The gd_tell() function reports the current position of the I/O pointer
25 of the field field_code in the dirfile(5) database specified by
26 dirfile.
27
28 Only RAW fields (and the implicit INDEX field) have field pointers as‐
29 sociated with them. Calling gd_tell() on a derived field will report
30 the position of the I/O pointer of the derived field only if all of
31 it's inputs are positioned the same. Otherwise, an error results.
32
33
35 Upon successful completion, gd_tell() returns a non-negative integer
36 indicating the I/O position of the specified field in samples. On er‐
37 ror, it returns a negative-valued error code. Possible error codes
38 are:
39
40 GD_E_ALLOC
41 The library was unable to allocate memory.
42
43 GD_E_BAD_CODE
44 The field specified by field_code, or one of the fields it uses
45 for input, was not found in the database.
46
47 GD_E_BAD_DIRFILE
48 The supplied dirfile was invalid.
49
50 GD_E_DIMENSION
51 The specified field or one of its inputs wasn't of vector type.
52
53 GD_E_DOMAIN
54 The I/O position of a derived field wasn't well defined because
55 its input fields simultaneously read from different places in
56 the same RAW field.
57
58 GD_E_INTERNAL_ERROR
59 An internal error occurred in the library while trying to per‐
60 form the task. This indicates a bug in the library. Please
61 report the incident to the maintainer.
62
63 GD_E_IO An error occurred while trying to open or read from a file on
64 disk containing a raw field.
65
66 GD_E_RECURSE_LEVEL
67 Too many levels of recursion were encountered while trying to
68 resolve field_code. This usually indicates a circular depen‐
69 dency in field specification in the dirfile.
70
71 GD_E_UNKNOWN_ENCODING
72 The encoding scheme of a RAW field could not be determined.
73 This may also indicate that the binary file associated with the
74 RAW field could not be found.
75
76 GD_E_UNSUPPORTED
77 Reading from dirfiles with the encoding scheme of the specified
78 dirfile is not supported by the library. See dirfile-encod‐
79 ing(5) for details on dirfile encoding schemes.
80
81 The error code is also stored in the DIRFILE object and may be re‐
82 trieved after this function returns by calling gd_error(3). A descrip‐
83 tive error string for the error may be obtained by calling
84 gd_error_string(3).
85
86
88 The gd_tell() function appeared in GetData-0.8.0.
89
90 In GetData-0.10.0, the error return from this function changed from -1
91 to a negative-valued error code.
92
93
95 gd_getdata(3), gd_open(3), gd_putdata(3), gd_seek(3).
96
97
98
99Version 0.10.0 25 December 2016 gd_tell(3)