diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html index e4c3e7950..5d886be4d 100644 --- a/Doc/Manual/Customization.html +++ b/Doc/Manual/Customization.html @@ -14,7 +14,6 @@
  • Exception handling with longjmp()
  • Handling C++ exceptions
  • Defining different exception handlers -
  • Applying exception handlers to specific datatypes.
  • Using The SWIG exception library
  • Object ownership and %newobject @@ -337,51 +336,13 @@ to attach exceptions to specific parts of a header file. For example: -

    9.1.5 Applying exception handlers to specific datatypes.

    - - -An alternative approach to using the %exception directive is to -use the "except" typemap. This allows you to attach an error handler -to specific datatypes and function name. The typemap is applied to -the return value of a function. For example :

    - -

    -

    %typemap(except) void *malloc {
    -    $action
    -    if (!$1) {
    -	PyExc_SetString(PyExc_MemoryError,"Out of memory in $symname");
    -        return NULL;
    -    }
    -}
    -
    -void *malloc(int size);
    -
    -
    - -When applied, this automatically checks the return value of -malloc() and raises an exception if it's invalid. For example -:

    - -

    -

    ->>> from example import *
    ->>> a = malloc(2048)
    ->>> b = malloc(1500000000)
    -Traceback (innermost last):
    -  File "<stdin>", line 1, in ?
    -MemoryError: Out of memory in malloc
    ->>>
    -
    - -When "except" typemaps are used, they override any exception handler defined with -%exception.

    - -

    -Compatibility note: The except typemap dates to earlier SWIG -releases and was intended to be a mechanism for pinpointing specific +Compatibility note: The %exception directive replaces +the functionality provided by the deprecated "except" typemap. +The typemap would allow exceptions to be thrown in the target +language based on the return type of a function and +was intended to be a mechanism for pinpointing specific declarations. However, it never really worked that well and the new -%exception directive is much better. The except typemap is preserved for now, but -may be deprecated in future versions. +%exception directive is much better.

    9.1.6 Using The SWIG exception library

    @@ -638,6 +599,6 @@ use will be described in the documentation for specific language modules.


    -
    SWIG 1.3 - Last Modified : December 9, 2001
    +
    SWIG 1.3 - Last Modified : June 1, 2003
    - \ No newline at end of file + diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html index a4ae75962..5deb4a623 100644 --- a/Doc/Manual/Typemaps.html +++ b/Doc/Manual/Typemaps.html @@ -450,7 +450,6 @@ int foo(int x, double y, char *s);

    @@ -3065,6 +3064,6 @@ for how to define typemaps of your own.


    -
    SWIG 1.3 - Last Modified : October 13, 2002
    +
    SWIG 1.3 - Last Modified : June 1 , 2003