Scroll to navigation

gd_linterp_tablename(3) GETDATA gd_linterp_tablename(3)


gd_linterp_tablename — retrieve the pathname of a look-up table in a Dirfile


#include <getdata.h>

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


The gd_linterp_tablename() function retrieves the pathname of the look-up table (LUT) used by the LINTERP field specified by field_code in the dirfile specified by dirfile. If field_code contains a valid representation suffix, it will be ignored.

Note: this function returns a fully canonicalised, absolute path. The value of the table member in a gd_entry_t object (see gd_entry(3)) is the path which appears in the format specification on disk, which may be a path relative to the fragment directory.


On success, gd_linterp_tablename() returns the full pathname of the LUT associated with the specified field in a newly-allocated buffer. By default, this buffer is allocated with malloc(3), but a different memory manager may be specified by calling gd_alloc_funcs(3) 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 gd_error(3). Possible error codes are:

The library was unable to allocate memory.
The field specified by field_code was not found.
The supplied dirfile was invalid.
The field specified by field_code was not a LINTERP field.

A descriptive error string for the error may be obtained by calling gd_error_string(3).


The gd_linterp_tablename() function appeared in GetData-0.8.1.


gd_alloc_funcs(3), gd_entry(3), gd_error(3), gd_error_string(3), dirfile(5), dirfile-format(5)

25 December 2016 Version 0.10.0