- Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmain.c
34 lines (27 loc) · 778 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<EXTERN.h>/* from the Perl distribution */
#include<perl.h>/* from the Perl distribution */
#include<SDL.h>
externchar**environ;
staticPerlInterpreter*my_perl; /* ** The Perl interpreter ***/
staticvoidxs_init (pTHX);
EXTERN_Cvoidboot_DynaLoader (pTHX_CV*cv);
EXTERN_Cvoid
xs_init(pTHX)
{
char*file=__FILE__;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
intmain(intargc, char*argv[])
{
char**env=environ;
PERL_SYS_INIT3(&argc,&argv, &env);
my_perl=perl_alloc();
perl_construct(my_perl);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_parse(my_perl, xs_init, argc, argv, (char**)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}