gd_endianness(3)

NAME
gd_endianness — report the byte sex of fields in a Dirfile

SYNOPSIS
#include <getdata.h>

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

DESCRIPTION
The function queries a dirfile(5) database specified by and retrieves the byte sex of the fragment indexed by 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 argument must point to a valid DIRFILE object previously created by a call to

RETURN VALUE
Upon successful completion, 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 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 This version also added the GD_ARM_ENDIAN and GD_NOT_ARM_ENDIAN flags.

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