1
2
3
4
5
6
7
8
9gd_fragmentname(3) GETDATA gd_fragmentname(3)
10
11
12
14 gd_fragmentname — retrieve a Dirfile format specification fragment name
15
16
18 #include <getdata.h>
19
20 const char* gd_fragmentname(const DIRFILE *dirfile, int index);
21
22
24 The gd_fragmentname() function queries a dirfile(5) database specified
25 by dirfile and returns the filename of the format specification frag‐
26 ment indexed by the non-negative index.
27
28 The dirfile argument must point to a valid DIRFILE object previously
29 created by a call to gd_open(3).
30
31 The fragment with index equal to zero is always the primary fragment
32 for the database (the file called format in the root dirfile directo‐
33 ry). The largest valid value of index is one less than the total num‐
34 ber of fragments, which may be obtained from a call to
35 gd_nfragments(3).
36
37
39 Upon successful completion, gd_fragmentname() returns a pointer to a
40 read-only character string containing the file name of the specified
41 fragment.
42
43 On error, this function returns NULL and stores a negative-valued error
44 code in the DIRFILE object which may be retrieved by a subsequent call
45 to gd_error(3). Possible error codes are:
46
47 GD_E_BAD_DIRFILE
48 The supplied dirfile was invalid.
49
50 GD_E_BAD_INDEX
51 The supplied index was out of range.
52
53 A descriptive error string for the error may be obtained by calling
54 gd_error_string(3).
55
56
58 The get_fragmentname() function appeared in GetData-0.4.0.
59
60 In GetData-0.7.0 this function was renamed to gd_fragmentname().
61
62
64 dirfile(5), gd_error(3), gd_error_string(3), gd_include(3),
65 gd_nfragments(3), gd_open(3), gd_parent_fragment(3)
66
67
68
69Version 0.10.0 25 December 2016 gd_fragmentname(3)