NAME

cxDataMagicCheck - check magic number of any data type

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 *cxDataMagicCheck(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 cxDataMagicCheck(data, description) integer data integer description

PARAMETERS

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

DESCRIPTION

cxDataMagicCheck verifies that the "magic number" of the IRIS Explorer data type pointed to by data is valid. The magic number is valid when the data is created, and is set invalid when the data is deleted. This check enables the user to determine whether the data has been deleted or not. It can also detect some memory corruption, if the magic number is damaged.

If an error is detected, the cxDataCheckAction defined by cxDataCheckingSet is called, and a cxDataCheckErrorInfo structure is returned. Otherwise, a NULL is returned. It is the user's responsibility to destroy the returned error structure using cxDataCheckErrorInfoDel. The contents of the error structure are described in more detail in cxDataCheck.

SEE ALSO

cxDataCheck(3E), cxDataMemBoundsCheck(3E), cxDataCheckErrorInfoDel(3E)
Last modified: Mon Nov 18 13:48:02 GMT 1996
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996