---
name: "CL_Assert"
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_Assert"
---

# CL\_Assert(3)

This is ClanLib's assertion class.

## NAME

CL\_Assert - This is ClanLib's assertion class.

## DESCRIPTION

It is needed because some implementations requires to be notified before ClanLib is exited. For instance the svgalib implementation need release the keyboard lock.

## CLASS MEMBERS

- static void **enable\_channels**(

  ```
  int channel_mask)
  ```

- static void **die**(

  ```
  bool a,
  const char *file,
  int line,
  const char *func,
  const char *assert_str)
  ```

- static void **info**(

  ```
  int channel,
  char *text,
  char *file,
  int line)
  ```

- static void **add\_listener**(

  ```
  CL_AssertListener *listener)
  ```

- static void **remove\_listener**(

  ```
  CL_AssertListener *listener)
  ```

## MEMBERS WITH DESCRIPTIONS

- static void **enable\_channels**(

  ```
  int channel_mask)
  ```

  ```
  Parameters:
  channel_mask - Channels to be enabled.
  ```

  ```
  Description:
  ```

  Enabled the error channels specified by the *channel\_mask*.This can be used to get extra debugging information from limitedparts of ClanLib.

- static void **die**(

  ```
  bool a,
  const char *file,
  int line,
  const char *func,
  const char *assert_str)
  ```

  ```
  Parameters:
  a - Asserts if false.
  file - Name of the file where the assert occoured.
  line - Line in the file where the assert occoured.
  func - Function in which the assert occoured.
  assert_str - String that describe the assertion check.
  ```

  ```
  Description:
  ```

  Produces an assert. This function shouldn't be called directly -instead, use the cl\_assert macro.

- static void **info**(

  ```
  int channel,
  char *text,
  char *file,
  int line)
  ```

  ```
  Parameters:
  channel - Channel to use.
  text - text to print.
  file - Name of the file where this was printed from.
  line - Line in the file where this was printed from.
  ```

  ```
  Description:
  ```

  Writes an info statements on the specified channel. Don't callthis one directly, instead use the cl\_info macro.

- static void **add\_listener**(

  ```
  CL_AssertListener *listener)
  ```

  ```
  Parameters:
  listener - The listener to be added.
  ```

  ```
  Description:
  ```

  Adds an assertion listener which will be called in case of anassertion.

- static void **remove\_listener**(

  ```
  CL_AssertListener *listener)
  ```

  ```
  Parameters:
  listener - The listener to be removed.
  ```

  ```
  Description:
  ```

  Removes an assertion listener.

## 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.
