Last modified: 24 September 2010
Name: H5Tset_order
Signature:
  herr_t `H5Tset_order`( hid_t `dtype_id`, H5T_order_t `order` )

Purpose:
  Sets the byte order of a datatype.

Description:
  `H5Tset_order` sets the byte order of a datatype.

  Byte order can currently be set to any of the following:

  `H5T_ORDER_LE` (`0`)
    Little-endian byte order
  `H5T_ORDER_BE` (`1`)
    Big-endian byte order
  `H5T_ORDER_VAX` (`2`)
    VAX mixed byte order

  `H5T_ORDER_MIXED` (`3`) is a valid value for `order` only when returned by the function `H5Tget_order`; it cannot be set with `H5Tset_order`.

  `H5T_ORDER_NONE` (`4`) is a valid value for `order`, but it has no effect. It is valid only for fixed-length strings and object and region references and specifies “no particular order.”

  The byte order of a derived datatype is initially the same as that of the parent type, but can be changed with `H5Tset_order`.

  This function cannot be used with a datatype after it has been committed.

  Special considerations:
  ENUM datatypes: Byte order must be set before any member on an ENUM is defined.

  Compound datatypes: Byte order is set individually on each member of a compound datatype; members of a compound datatype need not have the same byte order.

  Opaque datatypes: Byte order can be set but has no effect.

Parameters:

  hid_t `dtype_id` | IN: Identifier of datatype to set.
  H5T_order_t `order` | IN: Byte order constant.

Returns:
  Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5tset_order_f

      SUBROUTINE h5tset_order_f(type_id, order, hdferr)
        IMPLICIT NONE
        INTEGER(HID_T), INTENT(IN) :: type_id   ! Datatype identifier
        INTEGER, INTENT(IN) :: order            ! Datatype byte order
                                                ! Possible values are:
                                                !    H5T_ORDER_LE_F
                                                !    H5T_ORDER_BE_F
                                                !    H5T_ORDER_VAX_F
                                                !    H5T_ORDER_NONE_F
        INTEGER, INTENT(OUT) :: hdferr          ! Error code
                                                ! 0 on success and -1 on failure
      END SUBROUTINE h5tset_order_f

History:

  Release | Change
  1.8.6 | Function modified to work with all datatypes. `H5T_ORDER_MIXED` added to `H5T_order_t`.