gd_encoding(3)

NAME
gd_encoding — report the binary encoding of data in a Dirfile

SYNOPSIS
#include <getdata.h>

unsigned long gd_encoding(DIRFILE *dirfile, int fragment_index);

DESCRIPTION
The function queries a dirfile(5) database specified by and returns the data encoding for the fragment indexed by 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, 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 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 Possible error codes are: The supplied dirfile was invalid. The supplied index was out of range.

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

HISTORY
The function appeared in GetData-0.5.0.

In GetData-0.7.0, this function was renamed to

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