Best Practices for passing option hashes into XS
Simon Wistow
simon at thegestalt.org
Mon Apr 29 20:48:10 BST 2013
On Sun, Apr 28, 2013 at 04:55:54PM +0100, James Laver said:
> That sounds awfully like a compatibility shim for perl. Where using Perl datatypes would be appropriate.
Yeah - the shim stuff is now all in the .XS file mentioned in the
original mail.
For what it's worth you can see the code I'm working on here
https://github.com/simonwistow/Log-Syslog-Fast/tree/tls_support
(which, caveat, still needs checking over for correctness,
non-leakyness and general stinky code)
The relevant bits can be seen in Fast.xs and the options(..) method, as
used in new(..) but basically it's a XS method with variable args that
loops through the remained of the stack, 2 at a time, and then added the
variables to a struct and passes that struct into the C.
More information about the london.pm
mailing list