B-Hooks-XSUB-CallAsOp

 view release on metacpan or  search on metacpan

CallAsOp.xs  view on Meta::CPAN

	MY_CXT_INIT;
	MY_CXT.hook = NULL;

	MY_CXT.saved_args  = NULL;
	MY_CXT.saved_items = 0;

	MY_CXT.saved_op    = NULL;
}

void __test (...)
	PPCODE:
		TRAMPOLINE_SAVE_OP;
		TRAMPOLINE_SAVE_ARGS;
		assert(SP == &ST(-1));
		TRAMPOLINE(test_hook);

lib/B/Hooks/XSUB/CallAsOp.pm  view on Meta::CPAN


		/* or you can also delegate: */
		return PL_ppaddr[OP_FOO](aTHX);
	}



	MODULE = Some::XS	PACKAGE = Some::XS

	void foo ()
		PPCODE:
			TRAMPOLINE(foo);


	# later, in Perl land...
	# the trampoline hook is invoked in an opcode context, instead of as an XSUB
	Some::XS::foo();

=head1 USAGE

This module requires L<ExtUtils::Depends> to be used in your XS modules.



( run in 1.865 second using v1.01-cache-2.11-cpan-71847e10f99 )