I use SWIG to create wrappers for library C. The C library interface has a natural mapping to an object-oriented API (which I would like to show in the target language), but using SWIG directly to create wrappers will create a single object in the target language with all interfaces of the C library .
I see several options:
- Create a C ++ interface for the C library, and then wrap C ++ with SWIG
- Create custom classes in each target language that use a simple, non-OIO SWIG output inside
I would prefer bullet point 2, but my question is, is this OK? This is attractive because I would like to have complete control over the interface in the target language with minimal emphasis on the advanced features of SWIG.
source
share