NAME

cxDataCheck - check datatype at the current level of detail

C SPECIFICATION

#include <cx/DataOps.h>

typedef enum { cx_data_dead, cx_mem_size, cx_mem_bounds, cx_data_ok } cxDataCheckError;

typedef struct { cxDataCheckError error; void *ptr; char *msg;

} cxDataCheckErrorInfo;

cxDataCheckErrorInfo *cxDataCheck( void *data, char *description )

FORTRAN SPECIFICATION

integer cx_data_dead
integer cx_mem_size
integer cx_mem_bounds
integer cx_data_ok

parameter (cx_data_dead = 0) parameter (cx_mem_size = 1) parameter (cx_mem_bounds = 2) parameter (cx_data_ok = 3)

integer function cxDataCheck(data, description) integer data integer description

PARAMETERS

data
Data to be checked.
description
Character string describing where the check is being performed.

DESCRIPTION

cxDataCheck checks the integrity of the data pointed to by data, at the cxDataCheckLevel specified by cxDataCheckingSet. If an error condition is detected, the current cxDataCheckAction routine is called, and an cxDataCheckErrorInfo structure is created and returned. It is the programmer's responsibility to destroy the returned structure using cxDataCheckErrorInfoDel.

The error field of the returned structure enumerates the actual error detected. The ptr field points to the actual offending memory. The msg field contains a message that helps trace the exact location of the error. For example, the following code:

would return an error structure in which error is cx_ndim_range, ptr is the address of lat->nDim, and the trace message is something like this: The trace message and ptr field are especially valuable when an error occurs in nested IRIS Explorer types, e.g. the nDim in the cxCoord in the cxLattice in the second layer of a cxPyramid.

If no error is detected, a NULL is returned.

SEE ALSO

cxDataCheckingSet(3E), cxDataMagicCheck(3E), cxDataMemBoundsCheck(3E), cxDataCheckErrorInfoDel(3E), cxDataCheckErrorInfoGet(3E)
Last modified: Mon Nov 18 13:47:49 GMT 1996
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996