#include <cx/DataOps.h>typedef enum { cx_check_magic cx_check_mem_bounds } cxDataCheckLevel;
typedef enum { cx_check_ignore cx_check_warning cx_check_halt cx_check_abort cx_check_callback } cxDataCheckAction;
typedef void (*cxDataCheckCallback)( cxDataCheckErrorInfo*, void* );
void cxDataCheckingSet( cxDataCheckLevel level, cxDataCheckAction action, cxDataCheckCallback callback );
integer cx_check_magic integer cx_check_mem_boundsparameter (cx_check_magic = 0) parameter (cx_check_mem_bounds = 1)
integer cx_check_ignore integer cx_check_warning integer cx_check_halt integer cx_check_abort integer cx_check_callback
parameter (cx_check_ignore = 0) parameter (cx_check_warning = 1) parameter (cx_check_halt = 2) parameter (cx_check_abort = 3) parameter (cx_check_callback = 4)
typedef void (*cxDataCheckCallback)( cxDataCheckError, void* );
subroutine cxDataCheckingSet( level, action, callback ) integer level integer action integer callback
cxDataCheckingSet defines the level of detail of the checking and what action is to be performed when an error is detected. Data is checked when it is stored in input or output ports, and whenever it is extracted from an input port by cxInputDataGet. The level parameter defines the amount of checking that is to be done.
The action parameter defines the action to be taken when an error is detected.
The default action is for magic numbers to be checked on all data reference count changes and a warning to be issued. Magic number checking is always performed to prevent a module from attempting to lock a the reference count of data that has been damaged, which would inadvertently (and permanently) lock all modules out of the data arena. The level parameter values are listed in order of strictness, and each subsequent value implies that the lower level test is also done. That is, the magic number is always checked before the memory bounds.
The cxDataCheckCallback routines cxDataWarning, cxDataHalt, and cxDataAbort implement the cx_check_warning, cx_check_halt, and cx_check_abort actions. They are defined publicly so the user may access them directly. For example, the default actions can be restored by the following call:
cxDataCheckingSet( cx_check_magic,