---
name: "CL_Endian"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_Endian"
---

# CL\_Endian(3)

Endianess management class.

## NAME

CL\_Endian - Endianess management class.

## DESCRIPTION

The CL\_Endian class is used to convert between different endianess. There are also a set of defines to the lazy developer:

-

  ```
  #define SWAP_IF_BIG(i)
  #define SWAP_IF_LITTLE(i)
  #define SWAP_IF_BIG_ALOT(i, times)
  #define SWAP_IF_LITTLE_ALOT(i, times)
  #define IS_SYSTEM_64BIT()
  ```

Each of these defines call CL\_Endian::is\_system\_big() and CL\_Endian::swap. For the exact definition of the defines, have a look in ClanLib/Layer1/IOData/API/endian.h

## CLASS MEMBERS

- static void **swap**(

  ```
  void *data,
  int type_size)
  ```

- static void **swap**(

  ```
  void *data,
  int type_size,
  int total_times)
  ```

- static bool **is\_system\_big**()

  - static bool **is\_system\_64bit**()

  ## MEMBERS WITH DESCRIPTIONS

- static void **swap**(

  ```
  void *data,
  int type_size)
  ```

  ```
  Parameters:
  data - Data to be swapped.
  type_size - Size of datatype to be swapped.
  ```

  ```
  Description:
  ```

  Swaps the bytes between little and big endian.

- static void **swap**(

  ```
  void *data,
  int type_size,
  int total_times)
  ```

  ```
  Parameters:
  data -Data to be swapped.
  type_size - Size of datatype to be swapped.
  total_times - Number of 'type_size' size data chunks to be swapped.
  ```

  ```
  Description:
  ```

  Swaps larger amounts of data between little and big endian.

- static bool **is\_system\_big**()

  ```
  Description:
  ```

  Returns true if big endian system.

  ```
  Return value:
  ```

  True if big endian system, false otherwise.

- static bool **is\_system\_64bit**()

  ```
  Description:
  ```

  Returns true if 64 bit system.

  ```
  Return value:
  ```

  True if 64 bit, false otherwise.

## SEE ALSO

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
