]> git.vpit.fr Git - perl/modules/Sub-Op.git/blobdiff - t/Sub-Op-Test/Test.xs
Rename Sub::Op::Test to Sub::Op::LexicalSub
[perl/modules/Sub-Op.git] / t / Sub-Op-Test / Test.xs
diff --git a/t/Sub-Op-Test/Test.xs b/t/Sub-Op-Test/Test.xs
deleted file mode 100644 (file)
index 4a7b970..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* This file is part of the Sub::Op Perl module.
- * See http://search.cpan.org/dist/Sub-Op/ */
-
-#define PERL_NO_GET_CONTEXT
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#define __PACKAGE__     "Sub::Op::Test"
-#define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
-
-#include "sub_op.h"
-
-STATIC HV *sub_op_test_map = NULL;
-
-STATIC OP *sub_op_test_check(pTHX_ OP *o, void *ud_) {
- char buf[sizeof(void*)*2+1];
- SV *cb = ud_;
-
- (void) hv_store(sub_op_test_map, buf, sprintf(buf, "%"UVxf, PTR2UV(o)), cb, 0);
-
- return o;
-}
-
-STATIC OP *sub_op_test_pp(pTHX) {
- dSP;
- dMARK;
- SV *cb;
- int i, items;
-
- {
-  char buf[sizeof(void*)*2+1];
-  SV **svp;
-  svp = hv_fetch(sub_op_test_map, buf, sprintf(buf, "%"UVxf, PTR2UV(PL_op)), 0);
-  if (!svp)
-   RETURN;
-  cb = *svp;
- }
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(MARK);
-
- items = call_sv(cb, G_ARRAY);
-
- SPAGAIN;
- for (i = 0; i < items; ++i)
-  SvREFCNT_inc(SP[-i]);
- PUTBACK;
-
- FREETMPS;
- LEAVE;
-
- return NORMAL;
-}
-
-/* --- XS ------------------------------------------------------------------ */
-
-MODULE = Sub::Op::Test      PACKAGE = Sub::Op::Test
-
-PROTOTYPES: ENABLE
-
-BOOT:
-{
- sub_op_test_map = newHV();
-}
-
-void
-_init(SV *name, SV *cb)
-PROTOTYPE: $$
-PREINIT:
- sub_op_config_t c;
-PPCODE:
- if (SvROK(cb)) {
-  cb = SvRV(cb);
-  if (SvTYPE(cb) >= SVt_PVCV) {
-   c.name  = SvPV_const(name, c.len);
-   c.check = sub_op_test_check;
-   c.ud    = SvREFCNT_inc(cb);
-   c.pp    = sub_op_test_pp;
-   sub_op_register(aTHX_ &c);
-  }
- }
- XSRETURN(0);