Main Page   Compound List   File List   Compound Members   File Members  

csldefs.h File Reference

#include <csl/cslconfig.h>

Go to the source code of this file.

Defines

#define NULL   ((void*) 0)
 null pointer. More...

#define TRUE   (!FALSE)
 Boolean true. More...

#define FALSE   (0)
 Boolean false. More...

#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 Return maximum. More...

#define MIN(a, b)   ((a) > (b) ? (b) : (a))
 Return minimum. More...

#define CLAMP(x, low, high)   (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
 Clamp data within a range. More...

#define CSL_BREAKPOINT()   ((void) raise (5 ))
 Breakpoint exception. More...


Typedefs

typedef int CslBool
 Boolean type. More...

typedef int CslByte
 Byte-sized type. More...


Detailed Description

This file defines some common definitions that can be used in CSL for convenience and portability.


Define Documentation

#define CLAMP x,
low,
high       (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
 

Clamp data within a range.

Clamp a value between the values low and high, i.e. if value is larger than high set it to high. If it is lower than low, set it to low, otherwise leave it unchanged. Works with any data type.

Parameters:
x  data value
low  lower limit
high  higher limit
Returns:
the clamped value of x

 
#define CSL_BREAKPOINT      ((void) raise (5 ))
 

Breakpoint exception.

Raise a breakpoint exception in a portable way. If running under a debugger this will cause the application to stop and allow debugging. If running outside a debugger it will raise a SIGTRAP exception which by default will terminate the program.

#define FALSE   (0)
 

Boolean false.

Portable value for boolean false, if not already defined.

#define MAX a,
     ((a) > (b) ? (a) : (b))
 

Return maximum.

Return the maximum of two values.

Parameters:
a  First value.
b  Second value.
Returns:
The larger of a and b

#define MIN a,
     ((a) > (b) ? (b) : (a))
 

Return minimum.

Return the minimum of two values.

Parameters:
a  First value.
b  Second value.
Returns:
The lesser of a and b

#define NULL   ((void*) 0)
 

null pointer.

Portable value for null pointer, if not already defined.

#define TRUE   (!FALSE)
 

Boolean true.

Portable value for boolean true, if not already defined.


Typedef Documentation

typedef int CslBool
 

Boolean type.

A portable data type for Boolean values.

typedef int CslByte
 

Byte-sized type.

A portable data type for byte values.


Generated on Wed Oct 31 18:45:21 2001 for CSL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001