in reply to How to let my XS module interact with existing XS module?

I did some study on the Perl's ecology of XS system. It seems an typemap can be shared only if its author made it using ExtUtils::Typemap as a module. I also found that Cairo's main typemap is auto-generated at pre-compilation stage of the module.

So it seems I cannot use the existing Cairo wrapper to cooperate with the wrapper of my lib. I would consider a re-design of my API to allow it working without using Cairo's types as function parameter, like this:

typedef enum { SURFACE_PDF, SURFACE_SVG, SURFACE_IMAGE, SURFACE_PS } SurfaceType; class MyPage { MyPage(SurfaceType type); };

Replies are listed 'Best First'.
Re^2: How to let my XS module interact with existing XS module? (ExtUtils::Depends)
by Anonymous Monk on Aug 16, 2013 at 07:44 UTC

    It seems an typemap can be shared only if its author made it using ExtUtils::Typemap as a module

    Never heard of that. Its a file, if its installed, and you can find it, you can include it

    https://metacpan.org/module/ExtUtils::MakeMaker#TYPEMAPS

    Pango-1.221\blib\arch\Pango\Install\Files.pm Pango-1.221\blib\arch\Pango\Install\pango-perl-autogen.h Pango-1.221\blib\arch\Pango\Install\pango-perl-versions.h Pango-1.221\blib\arch\Pango\Install\pango-perl.h Pango-1.221\blib\arch\Pango\Install\pango-perl.typemap Pango-1.221\blib\arch\Pango\Install\pango.typemap

    Gtk2::Install::Files

    Seems Gtk2::Install::Files is generated by ExtUtils::Depends, so just use ExtUtils::Depends in Makefile.PL and ... less work for you :)