1get_fragmentname(3) GETDATA get_fragmentname(3)
2
3
4
6 get_fragmentname — retrieve a dirfile format file fragment name
7
9 #include <getdata.h>
10
11 const char* get_fragmentname(const DIRFILE *dirfile, int index);
12
14 The get_fragmentname() function queries a dirfile(5) database specified
15 by dirfile and returns the filename of the format file fragment indexed
16 by the non-negative index.
17
18 The dirfile argument must point to a valid DIRFILE object previously
19 created by a call to dirfile_open(3).
20
21 The format file fragment with index equal to zero is always the primary
22 format file for the database (the file called format in the root
23 dirfile directory). The largest valid value of index is one less than
24 the total number of format file fragments, which may be obtained from a
25 call to get_nfragments(3).
26
28 Upon successful completion, get_fragmentname() returns a pointer to a
29 read-only character string containing the file name of the specified
30 format file fragment. On error, get_fragmentname() returns NULL and
31 sets the dirfile error a non-zero error value. Possible error values
32 are:
33
34 GD_E_BAD_DIRFILE
35 The supplied dirfile was invalid.
36
37 GD_E_BAD_INDEX
38 The supplied index was out of range.
39
40 The dirfile error may be retrieved by calling get_error(3). A descrip‐
41 tive error string for the last error encountered can be obtained from a
42 call to get_error_string(3).
43
44
46 dirfile(5), dirfile_include(3), dirfile_open(3), get_error(3), get_er‐
47 ror_string(3), get_nfragments(3), get_parent_fragment(3)
48
49
50
51Version 0.5.0 20 December 2008 get_fragmentname(3)