gd_encoding3
Report the binary encoding of data in a dirfile
Usage
#include <getdata.h>
unsigned long gd_encoding(DIRFILE *dirfile, int fragment_index);
Overview
The gd_encoding() function queries a dirfile(5) database specified by dirfile and returns the data encoding for the fragment indexed by fragment_index. The data encoding of a fragment indicate the encoding of data files associated with RAW fields defined in the specified fragment. The encoding of a fragment containing no RAW fields is ignored.
Return value
Upon successful completion, gd_encoding() returns the binary encoding of the specified fragment, which will one of the following symbols:
-
GD_UNENCODED,GD_BZIP2_ENCODED,GD_FLAC_ENCODED,GD_GZIP_ENCODED,GD_LZMA_ENCODED,GD_SIE_ENCODED,GD_SLIM_ENCODED,GD_TEXT_ENCODED,GD_ZZIP_ENCODED,GD_ZZSLIM_ENCODED,GD_ENC_UNSUPPORTED.
If the encoding scheme specified in the dirfile metadata is unknown to GetData, GD_ENC_UNSUPPORTED will be returned. See gd_open(3) and dirfile-encoding(5) for the meanings of the other symbols and details on the supported encoding schemes.
On error, this function returns zero 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_BAD_DIRFILE The supplied dirfile was invalid.
.TP 8 GD_E_BAD_INDEX The supplied index was out of range.
A descriptive error string for the error may be obtained by calling gd_error_string(3).
Releases
7 releases since Debian 7 (Wheezy); the text changed 2 times.