in reply to Re^4: Pursuading an XS module to use a routine from another XS module.
in thread Pursuading an XS module to use a routine from another XS module.

it shouldn't not be necessary to c&p code from both modules, into a third

It's not (at least in the scenario that I was referring to) ... you have to add some xsubs to "both" modules, but there's no need for a third module.

But XS dlls do not export the addresses of the routines they contain directly

Having never tried to directly access a perl dll's functions before, I hadn't really considered that ... but you're quite right. And that leads me to wonder just how one would, eg, access a perl dll's functionality in an Inline::C or XS situation on Win32. Any takers ? Presumably, GetProcAddress() is useless to us as it returns the address of *exported* functions/variables only. But, equally presumably, it *is* possible to get at the dll's functionality ...

Cheers,
Rob
  • Comment on Re^5: Pursuading an XS module to use a routine from another XS module.

Replies are listed 'Best First'.
Re^6: Pursuading an XS module to use a routine from another XS module.
by BrowserUk (Patriarch) on Sep 03, 2008 at 12:32 UTC
    It's not (at least in the scenario that I was referring to) ... you have to add some xsubs to "both" modules, but there's no need for a third module.

    Um. If one ever hopes that others would be able to replicate ones results, then you either create a third module from the two and upload that to CPAN, or you draft patches for both modules and try to get them accepted by both authors. The former is easier and more likely to succeed, but wholly unsatisfactory.

    And that leads me to wonder just how one would, eg, access a perl dll's functionality in an Inline::C or XS situation on Win32. Any takers ?

    I've been trying to pick my way through dynaloader to work out what/how/when it does what it does, but it was written/influenced by that bunch of core people back in the mid 90's that don't (have never) dained to share their knowledge and expertise with us plebeians here at PM :(

    Even the few of that illustrious list that have ever lowered themeselves to posting here at PM, seem to have disconnected from this part of the community.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I've been trying to pick my way through dynaloader

      I got as far as 'perldoc DynaLoader' ... and thought "Naaah ...".

      I will, however, post to the XS mailing list with a general question about "how one might access, via Inline::C, a perl dll's functions on win32" (since that has piqued my interest). Bit of a long shot - but if it bears fruit I'll let you know.

      Cheers,
      Rob