There are several types and macros defined for use with the BIC Volume IO Library.
All function declarations in the library are preceded with either
the word ** public** or

#define public #define private static

A type for logical values is defined:

typedef int BOOLEAN #define FALSE 0 #define TRUE 1 #define OFF FALSE #define ON TRUE

Other useful types defined include:

typedef double Real; #define MAX_STRING_LENGTH 200 typedef char STRING[MAX_STRING_LENGTH+1]; typedef enum { OK, ERROR, INTERNAL_ERROR, END_OF_FILE, QUIT } Status; typedef char Smallest_int;

Some macros useful for general programming include:

N_DIMENSIONS

- A constant equal to 3, the number of dimensions in the real world.

X

- A constant equal to 0, used as an index into various XYZ structures.

Y

- A constant equal to 1, used as an index into various XYZ structures.

Z

- A constant equal to 2, used as an index into various XYZ structures.

SIZEOF_STATIC_ARRAY( array )

- returns the number of elements in a statically allocated array,
for example,

{ int size; int array[] = { 1, 2, 3 }; size = SIZEOF_STATIC_ARRAY( array ); /* == 3 */ }

ROUND( x )

- returns the nearest integer to the
. If halfway in between two integers, returns the higher of the two.`x`

IS_INT( x )

- returns
if the real argument is exactly an integer.`TRUE`

FRACTION( x )

- returns the fractional part of the argument.

FLOOR( x )

- returns the largest integer less than or equal to the argument.

CEILING( x )

- returns the smallest integer greater than or equal to the argument.

ABS( x )

- returns the absolute value of an integer or real.

MAX( x, y )

- returns the maximum of two integers or reals.

MAX3( x, y, z )

- returns the maximum of three integers or
reals.

MIN( x, y )

- returns the minimum of two integers or reals.

MIN3( x, y, z )

- returns the minimum of three integers or reals.

INTERPOLATE( alpha, a, b )

- returns the interpolation between
and`a`, where`b`is in the range zero to one.`alpha`

PI

- returns the value of .

DEG_TO_RAD

- returns the number of radians per degrees,
used to multiply an angle in degrees to result in radians.

RAD_TO_DEG

- returns the number of degrees per radian,
used to multiply an angle in radians to result in degrees.

IJ( i, j, nj )

- converts the indices
of a 2-D
by`ni`array into a single index, based on row-major order.`nj`

IJK( i, j, k, nj, nk )

- converts the indices
of a 3-D
by`ni`by`nj`array into a single index, based on row-major order.`nk`

for_less( i, start, end )

- performs a for loop where
starts at`i`and increments until it is greater than or equal to`start`. Equivalent to`end`.`for( i = start; i < end; ++i )`

for_inclusive( i, start, end )

- performs a for loop where
starts at`i`and increments until it is greater than`start`. Equivalent to`end`.`for( i = start; i <= end; ++i )`

GLUE(x,y)

- Special C source macro to stick two different
identifiers together, i.e.,
results in`GLUE(colour,_name)`.`colour_name`

GLUE3(x,y,z)

- Special C source macro to stick three different
identifiers together, i.e.,
results in`GLUE(a,b,c)`.`abc`

Fri Feb 17 15:37:42 EST 1995