OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_swap.h File Reference
#include <stdio.h>
Include dependency graph for epr_swap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void byte_swap_short (short *buffer, epr_uint number_of_swaps)
 
void byte_swap_ushort (epr_ushort *buffer, epr_uint number_of_swaps)
 
void byte_swap_long (int *buffer, epr_uint number_of_swaps)
 
void byte_swap_uint (epr_uint *buffer, epr_uint number_of_swaps)
 
void byte_swap_float (float *buffer, epr_uint number_of_swaps)
 
void epr_swap_endian_order (const EPR_SField *field)
 
int epr_is_big_endian_order ()
 
int epr_is_little_endian_order ()
 

Function Documentation

◆ byte_swap_float()

void byte_swap_float ( float *  buffer,
epr_uint  number_of_swaps 
)

Swaps bytes within NUMBER_OF_SWAPS four-byte words, starting at address BUFFER.

Parameters
bufferthe one element typed buffer to convert for a little endian order machine
number_of_swapsnumber of elements to convert

Definition at line 131 of file epr_swap.c.

◆ byte_swap_long()

void byte_swap_long ( int *  buffer,
epr_uint  number_of_swaps 
)

◆ byte_swap_short()

void byte_swap_short ( short *  buffer,
epr_uint  number_of_swaps 
)

Swaps bytes within NUMBER_OF_SWAPS two-byte words, starting at address BUFFER.

Parameters
bufferthe one element typed buffer to convert for a little endian order machine
number_of_swapsnumber of elements to convert

Definition at line 43 of file epr_swap.c.

◆ byte_swap_uint()

void byte_swap_uint ( epr_uint buffer,
epr_uint  number_of_swaps 
)

Swaps bytes within NUMBER_OF_SWAPS four-byte words, starting at address BUFFER.

Parameters
bufferthe one element typed buffer to convert for a little endian order machine
number_of_swapsnumber of elements to convert

Definition at line 112 of file epr_swap.c.

◆ byte_swap_ushort()

void byte_swap_ushort ( epr_ushort buffer,
epr_uint  number_of_swaps 
)

Swaps bytes within NUMBER_OF_SWAPS two-byte words, starting at address BUFFER.

Parameters
bufferthe one element typed buffer to convert for a little endian order machine
number_of_swapsnumber of elements to convert

Definition at line 93 of file epr_swap.c.

◆ epr_is_big_endian_order()

int epr_is_big_endian_order ( )

Returns a oolean value indicating whether this code run's on a little endian order machine or not.

1 stands for little endian (BE), 0/code> otherwise

Definition at line 171 of file epr_swap.c.

◆ epr_is_little_endian_order()

int epr_is_little_endian_order ( )

A boolean value indicating whether this code run's on a little endian order machine or not.

1 stands for little endian (LE), 0 stands for big endian (BE). Returns a oolean value indicating whether this code run's on a little endian order machine or not.

1 stands for little endian (LE), 0/code> otherwise

Definition at line 152 of file epr_swap.c.

◆ epr_swap_endian_order()

void epr_swap_endian_order ( const EPR_SField *  field)

Converts bytes for a little endian order machine

Parameters
fieldthe pointer at data reading in

Definition at line 192 of file epr_swap.c.