Help for this page

Select Code to Download


  1. or download this
    %header %{
    #undef SWIG_Error            // if placed in %wrapper it will be at th
    +e end, too late for the wrapper code
    #define SWIG_Error(code, msg)                           call_perl_carp
    +((char *) SWIG_ErrorType(code), (char *) msg)
    ...
    use Carp;                       # ensure Carp.pm is available for wrap
    +per argument validation
    
    %}
    
  2. or download this
    #define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail
    +; }
    #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG
    +_RuntimeError, msg); SWIG_fail; } else
    #define SWIG_SetError(str)                              SWIG_Error(SWI
    +G_RuntimeError, str)
    
  3. or download this
        if (!argp2) {
          SWIG_exception_fail(SWIG_ValueError, "invalid null reference "
    "in method '" "new_Foo" "', argument " "2"" of type '" "Bar &""'");
        }
    
  4. or download this
    #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWI
    +G_fail; } while(0) 
    #define SWIG_Error(code, msg)                           sv_setpvf(GvSV
    +(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
    ...
    SWIG_Perl_ErrorType(int code) { C code that returns a string describin
    +g the error code }
    #define SWIG_fail                                       goto fail
    #define SWIG_croak_null() croak(Nullch)