Re: How to port SWIG Python interface file to JavaScript

William S Fulton <[email protected]> Mon, 20 Nov 2023 18:34:51 +0000
Newsgroups gmane.comp.programming.swig
Message-ID <CANGqftCOQMT1UgfYS3_nOPYEuzq8LN85VpW-UgPNA72d+KxDRw@mail.gmail.com>
The director feature is not implemented in Javascript, so you'd need to
submit
a patch to SWIG to add this feature if you really need it. I'd say that this
is non-trivial to implement though.

There is no equivalent to %pythoncode in Javascript, so SWIG would also need
modifying to add some sort of equivalents. Not very hard to do.

The typemap code your project has with Python API calls, PyInt_Check etc,
will need
converting into the Node.js API equivalents.

William

On Thu, 16 Nov 2023 at 08:31, Wang, Lin <[email protected]> wrote:

> Hello SWIG community,
>
>
> There is a Python package that uses SWIG to call the underlying C++
> functionalities. And I want to develop a Node.js package that also uses
> SWIG and call the same C++ library, what if I want to reuse the existing
> SWIG Python interface/input file?
>
>
> Specifically, how can I deal with the Python specific features like the
> following,
>
>    -
>
>    ●%feature("director")
>    -
>
>    ●%pythoncode
>    -
>
>    ●PyInt_Check, PyLong_Check etc. in %typemap block
>
>
> Thanks,
>
> Lin
> _______________________________________________
> Swig-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user