1get_fragment_index(3) GETDATA get_fragment_index(3)
2
3
4
6 get_fragment_index — retrieve the fragment containing a dirfile field
7
9 #include <getdata.h>
10
11 int get_fragment_index(const DIRFILE *dirfile, const char *field_code);
12
14 The get_fragment_index() function queries a dirfile(5) database speci‐
15 fied by dirfile and returns the index number of the fragment defining
16 the field specified by field_code. If field_code contains a represen‐
17 tation suffix, it will be ignored.
18
20 Upon successful completion, get_fragment_index() returns the requested
21 fragment index. On error, get_fragment_index() returns -1 and sets the
22 dirfile error a non-zero error value. Possible error values are:
23
24 GD_E_BAD_DIRFILE
25 The supplied dirfile was invalid.
26
27 GD_E_BAD_CODE
28 The field specified by field_code was not found in the data‐
29 base.
30
31 GD_E_BAD_REPR
32 The representation suffix specified in field_code was not
33 recognised.
34
35 The dirfile error may be retrieved by calling get_error(3). A descrip‐
36 tive error string for the last error encountered can be obtained from a
37 call to get_error_string(3).
38
39
41 dirfile_open(3), get_entry(3), get_error(3), get_error_string(3),
42 get_fragmentname(3), get_parent_fragment(3), dirfile(5)
43
44
45
46Version 0.6.0 19 October 2009 get_fragment_index(3)