1
2
3
4
5
6
7
8
9gd_parent_fragment(3) GETDATA gd_parent_fragment(3)
10
11
12
14 gd_parent_fragment — retrieve the parent fragment of a fragment in a
15 Dirfile
16
17
19 #include <getdata.h>
20
21 int gd_parent_fragment(DIRFILE *dirfile, int fragment_index);
22
23
25 The gd_parent_fragment() function queries a dirfile(5) database speci‐
26 fied by dirfile and returns the index of the fragment which contains
27 the INCLUDE directive for the fragment indexed by fragment_index.
28
29 Since the primary format specification fragment is not included in any
30 other fragment, passing zero for fragment_index will result in an er‐
31 ror.
32
33
35 On success, gd_parent_fragment() returns the index of the specified
36 fragment's parent. On error, gd_parent_fragment() returns a negative-
37 valued error code. Possible error codes are:
38
39 GD_E_BAD_DIRFILE
40 The supplied dirfile was invalid.
41
42 GD_E_BAD_INDEX
43 The supplied index was out of range, or was equal to zero.
44
45 The error code is also stored in the DIRFILE object and may be re‐
46 trieved after this function returns by calling gd_error(3). A descrip‐
47 tive error string for the error may be obtained by calling
48 gd_error_string(3).
49
50
52 The get_parent_fragment() function appeared in GetData-0.5.0.
53
54 In GetData-0.7.0, this function was renamed to gd_parent_fragment().
55
56 In GetData-0.10.0, the error return from this function changed from -1
57 to a negative-valued error code.
58
59
61 dirfile(5), gd_include(3), gd_open(3), gd_fragmentname(3),
62 gd_nfragments(3)
63
64
65
66Version 0.10.0 25 December 2016 gd_parent_fragment(3)