NCEPLIBS-bufr
12.0.0
|
Return a copy of an input integer word with the bytes reversed. More...
Go to the source code of this file.
Functions/Subroutines | |
function | irev (N) |
This function will, when the local machine is "little-endian" (i.e., when it uses a right to left scheme for numbering the bytes within a machine word), return a copy of an input integer word with the bytes reversed. More... | |
Return a copy of an input integer word with the bytes reversed.
Definition in file irev.F.
function irev | ( | N | ) |
This function will, when the local machine is "little-endian" (i.e., when it uses a right to left scheme for numbering the bytes within a machine word), return a copy of an input integer word with the bytes reversed.
Although, by definition (within WMO Manual 306), a BUFR message is a stream of individual octets (i.e., bytes) that is independent of any particular machine representation, the BUFR archive library software often needs to interpret all or parts of two or more adjacent bytes in order to construct an integer word. By default, the software uses the "big-endian" (left to right) scheme for numbering bytes. By reversing the bytes, irev() allows the integer word to be properly read or written (depending on whether input or output operations, respectively, are being performed) on "little-endian" machines. If the local machine is "big-endian", irev() simply returns a copy of the same integer that was input.
[in] | N | - integer: integer word with bytes ordered according to the "big-endian" numbering scheme |