Up: GEOS SDK TechDocs | Up | Prev: DriveGetDefaultMedia() ... | Next: ECCheckHugeArray() ...

EC()

void	EC(line);

This macro defines a line of code that will only be compiled into the error-checking version of the geode. The line parameter of the macro is the actual line of code. When the EC version of the program is compiled, the line will be treated as a normal line of code; when the non-EC version is compiled, the line will be ignored.

See Also: NEC().

EC_BOUNDS()

void	EC_BOUNDS(addr);

This macro adds an address check to the error-checking version of a program. When the EC version of the program is compiled, the address check will be included; when the non-EC version is compiled, the address check will be left out. The addr parameter is the address or pointer to be checked.

The macro expands to a call to ECCheckBounds() on the specified address or pointer. If the address is out of bounds, the program will stop with a call to FatalError() .

See Also: ECCheckBounds().

EC_ERROR()

void	EC_ERROR(code);

This macro inserts a call to FatalError() in the error-checking version of the program and does nothing to the non-EC version. When the program gets to this point, it will halt and put up an error message corresponding to the specified error code . If a condition should be checked before calling FatalError() , you can use EC_ERROR_IF() instead.

EC_ERROR_IF()

void	EC_ERROR_IF(test, code);

This macro inserts a conditional call to FatalError() in the error-checking version of a program; it does nothing for the non-EC version. The test parameter is a Boolean value that, if true , will cause the FatalError() call to be made. If test is false , FatalError() will not be called.

EC_WARNING()

EC_WARNING(word warningCode);

This macro generates a warning for the debugger when executed by error-checking code; it has no effect when in non-EC code.

Include: ec.h

EC_WARNING_IF()

EC_WARNING_IF(<expr>, word warningCode)

When this macro is executed in error-checking code, it tests <expr>; if <expr> is non-zero, it generates a warning with code warningCode for the debugger.

In non-EC code, the macro has no effect (and <expr> is not evaluated).

Include: ec.h

ECCheckBounds()

void	ECCheckBounds(
        void	*address);

This routine checks to see if the given pointer is within bounds of the block into which it points. If assertions fail, a fatal error will occur. If the "lmem" EC flag is turned on and the pointer points within an LMem block, then this routine will also check that the pointer points to a valid chunk handle or a chunk within the LMem block.

Include: ec.h

ECCheckChunkArray()

void	ECCheckChunkArray(
        optr	o);

This routine checks the validity of the specified chunk array. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckChunkArrayHandles()

void	ECCheckChunkArrayHandles(
        MemHandle mh,
        ChunkHandle ch);

This routine checks the validity of the specified chunk array. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckClass()

void	ECCheckClass(
        ClassStruct *class);

This routine checks that the given pointer actually references a class definition. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckDriverHandle()

void	ECCheckDriverHandle(
        GeodeHandle gh);

This routine checks that the passed handle actually references a driver. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckEventHandle()

void	ECCheckEventHandle(
        EventHandle eh);

This routine checks that the passed handle actually references a stored message. If the assertions fail, a fatal error will occur.

ECCheckFileHandle()

void	ECCheckFileHandle(
        FileHandle file);

This routine checks that the passed handle actually is a file handle and references a file. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckGeodeHandle()

void	ECCheckGeodeHandle(
        GeodeHandle gh);

This routine checks that the passed handle references a loaded geode. If the assertions fail, a fatal error will occur.

Include: ec.h

ECCheckGStateHandle()

void	ECCheckGStateHandle(
        GStateHandle gsh);

This routine checks that the passed handle references a GState. If the assertions fail, a fatal error will occur.

Include: ec.h


Up: GEOS SDK TechDocs | Up | Prev: DriveGetDefaultMedia() ... | Next: ECCheckHugeArray() ...