Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (30 sloc) 0.791 kb
e993223 @pmurias Added p5test which test various stages of linking in a perl5 interpreter...
pmurias authored
1 #include <EXTERN.h>
2 #include <perl.h>
3
4 /* So that we can load XS using modules from our perl */
5 EXTERN_C void xs_init (pTHX);
6
7 EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
8
9 EXTERN_C void
10 xs_init(pTHX)
11 {
12 char *file = __FILE__;
13 dXSUB_SYS;
14
15 /* DynaLoader is a special case */
16 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
17 }
18
19 static PerlInterpreter *my_perl;
20 int main()
21 {
22 int argc = 1;
23 char *argv0[] = { "perl", NULL, 0 };
24 char **argv = argv0;
25 PERL_SYS_INIT(&argc,&argv);
26 my_perl = perl_alloc();
27 perl_construct(my_perl);
28 char *embedding[] = { "", "-e", "0" };
29 perl_parse(my_perl, xs_init, 3, embedding, NULL);
30 PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
31 eval_pv("print \"OK 2\\n\"",TRUE);
32 perl_destruct(my_perl);
33 perl_free(my_perl);
34 PERL_SYS_TERM();
35 }
Something went wrong with that request. Please try again.