gd_endianness3
Report the byte sex of fields in a dirfile
Usage
#include <getdata.h>
unsigned long gd_endianness(DIRFILE *dirfile, int fragment_index);
Overview
The gd_endianness() function queries a dirfile(5) database specified by dirfile and retrieves the byte sex of the fragment indexed by fragment_index. The byte sex of a fragment indicates the endianness of data files associated with RAW fields defined in the specified fragment. The endianness of a fragment containing no RAW fields is not meaningful.
The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).
Return value
Upon successful completion, gd_endianness() returns the byte sex of the specified fragment, which will be either GD_BIG_ENDIAN or GD_LITTLE_ENDIAN. This will be bitwise-or'd with either GD_ARM_ENDIAN or GD_NOT_ARM_ENDIAN, indicating whether double-precision floating point data in this fragment are stored in the old ARM middle-endian format.
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 1 time.