Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 3c88344d1f3d15057277d028d0022277 > files > 603

swig-1.3.11-4mdk.i586.rpm

/* File : example.i */
%module example

%{
#include "example.h"
%}

/* This example shows how to write an overloaded shadow function
   the behaves like C++.  We simply write the disambiguation code
   ourselves below using %feature */

%rename(bar_id) bar(int,double);

%feature("shadow") bar(int) {
def bar(*args):
    if len(args) == 3:
        return apply(examplec.Foo_bar_id,args)
    return apply(examplec.Foo_bar,args)
}

%include "example.h"