1
2
3
4
5
6
7
8
9gd_raw_filename(3) GETDATA gd_raw_filename(3)
10
11
12
14 gd_raw_filename — retrieve the pathname of a binary file in a Dirfile
15
16
18 #include <getdata.h>
19
20 char *gd_raw_filename(DIRFILE *dirfile, const char *field_code);
21
22
24 The gd_raw_filename() function reports the pathname of the file backing
25 the RAW field specified by field_code in the dirfile specified by
26 dirfile. If field_code contains a valid representation suffix, it will
27 be ignored.
28
29
31 On success, gd_raw_filename() returns the full pathname of the binary
32 file associated with the specified field in a newly-allocated buffer.
33 By default, this buffer is allocated with malloc(3), but a different
34 memory manager may be specified by calling gd_alloc_funcs(3) before
35 calling this function. The caller is responsible for deallocating the
36 returned buffer.
37
38 On error, this function returns NULL and stores a negative-valued error
39 code in the DIRFILE object which may be retrieved by a subsequent call
40 to gd_error(3). Possible error codes are:
41
42 GD_E_ALLOC
43 The library was unable to allocate memory.
44
45 GD_E_BAD_CODE
46 The field specified by field_code was not found.
47
48 GD_E_BAD_DIRFILE
49 The supplied dirfile was invalid.
50
51 GD_E_BAD_FIELD_TYPE
52 The field specified by field_code was not a RAW field.
53
54 GD_E_UNKNOWN_ENCODING
55 The encoding scheme of the specified field could not be deter‐
56 mined or was not understood by GetData.
57
58 A descriptive error string for the error may be obtained by calling
59 gd_error_string(3).
60
61
63 The get_raw_filename() function appeared in GetData-0.4.2. Memory for
64 the string it returned was managed by GetData.
65
66 In GetData-0.7.0, this function was renamed to gd_raw_filename().
67
68 In GetData-0.8.0, the returned string changed to a malloc'd buffer, and
69 the responsibility for freeing the buffer passed to the caller.
70
71
73 free(3), gd_entry(3), gd_error(3), gd_error_string(3), malloc(3),
74 dirfile(5), dirfile-encoding(5), dirfile-format(5)
75
76
77
78Version 0.10.0 25 December 2016 gd_raw_filename(3)