gd_raw_filename(3)

NAME
gd_raw_filename — retrieve the pathname of a binary file in a Dirfile

SYNOPSIS
#include <getdata.h>

char *gd_raw_filename(DIRFILE *dirfile, const char *field_code);

DESCRIPTION
The function reports the pathname of the file backing the RAW field specified by in the dirfile specified by If contains a valid representation suffix, it will be ignored.

RETURN VALUE
On success, returns the full pathname of the binary file associated with the specified field in a newly-allocated buffer. By default, this buffer is allocated with but a different memory manager may be specified by calling before calling this function. The caller is responsible for deallocating the returned buffer. On error, this function returns NULL and stores a negative-valued error code in the DIRFILE object which may be retrieved by a subsequent call to Possible error codes are: The library was unable to allocate memory. The field specified by was not found. The supplied dirfile was invalid. The field specified by was not a RAW field. The encoding scheme of the specified field could not be determined or was not understood by GetData.

A descriptive error string for the error may be obtained by calling

HISTORY
The function appeared in GetData-0.4.2. Memory for the string it returned was managed by GetData. In GetData-0.7.0, this function was renamed to In GetData-0.8.0, the returned string changed to a malloc'd buffer, and the responsibility for freeing the buffer passed to the caller.

SEE ALSO
dirfile(5), dirfile-encoding(5), dirfile-format(5)