gd_linterp_tablename(3)

gd_linterp_tablename3

Retrieve the pathname of a look-up table in a dirfile

Usage

#include <getdata.h>

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

Overview

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.

Return value

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:
.TP 8 GD_E_ALLOC The library was unable to allocate memory.
.TP 8 GD_E_BAD_CODE The field specified by field_code was not found.
.TP 8 GD_E_BAD_DIRFILE The supplied dirfile was invalid.
.TP 8 GD_E_BAD_FIELD_TYPE 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).

Releases

5 releases since Debian 9 (Stretch); the text changed 1 time.

  1. 9
  2. 10–13

History

The gd_linterp_tablename() function appeared in GetData-0.8.1.

From libgetdata-doc 0.11.0-15 in Debian 13 (Trixie). Parsed by carta from the page's man source.