dwww Home | Show directory contents | Find package

/**
 * Regression test for PHP bug: https://sourceforge.net/p/swig/bugs/1350/
 */

%module newobject3

%newobject factory::create;
%inline %{
class Product {};
class factory {
public:
    Product * create(short id, short type = 0);
    Product * create(const char * name, short type = 0);
};
%}

%{
Product * factory::create(short id, short type) {
    return (id && type >= 0) ? new Product : NULL;
}

Product * factory::create(const char * name, short type) {
    return (name && type >= 0) ? new Product : NULL;
}
%}

Generated by dwww version 1.15 on Tue Jul 2 00:28:21 CEST 2024.