ILE C/C++ Compiler Reference


cancel_handler

>>-#--pragma--cancel_handler------------------------------------>
 
>--(--function_name--+-,--0--------+--)------------------------><
                     '-,--com_area-'
 
 

Description

Specifies that the function named is to be enabled as a user-defined ILE cancel handler at the point in the code where the #pragma cancel_handler directive is located.

Any cancel handler that is enabled by a #pragma cancel_handler directive is implicitly disabled when the call to the function containing the directive is finished. The call is removed from the call stack, if the handler has not been explicitly disabled by the #pragma disable_handler directive.

Parameters

function_name
Specifies the name of the function to be used as a user-defined ILE cancel handler.

com_area
Used to pass information to the exception handler. If no com_area is required, specify zero as the second parameter of the directive. If a com_area is specified on the directive, it must be a variable of one of the following data types: integral, float, double, struct, union, array, enum, pointer, or packed decimal. The com_area should be declared with the volatile qualifier. It cannot be a member of a structure or a union.

See the Run-Time Library Reference for information about <except.h> and the typedef _CNL_Hndlr_Parms_T, a pointer which is passed to the cancel handler.

Notes on Usage

The handler function can take only 16-byte pointers as parameters.

This #pragma directive can only occur at a C language statement boundary and inside a function definition.

The compiler issues an error message if any of the following occurs:

See the WebSphere Development Studio: ILE C/C++ Programmer's Guide for examples and more information about using the #pragma cancel_handler directive.


[ Top of Page | Previous Page | Next Page | Table of Contents ]