NAME

cxMemBoundsCheck - check the memory bounds for an arbitrary area of data memory
#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 *cxMemBoundsCheck(void *ptr, size_t size )
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 cxMemBoundsCheck(ptr, description) integer ptr integer description
ptr
The data memory to be checked.
size
Minimum expected size of memory.
cxMemBoundsCheck checks to see that the bounds are intact around the memory pointed to by ptr. The memory is assumed to have been allocated to at least size bytes. If either bound is damaged, the cxDataCheckAction defined by cxDataCheckingSet is called, 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. cxDataCheckingSet(3E), cxDataCheckErrorInfoDel(3E)
Last modified: Mon Nov 6 16:33:29 GMT 2000
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996