2 * "The Road goes ever on and on, down from the door where it began."
10 static void xs_init (pTHX);
13 RunPerl(int argc, char **argv, char **env, void *iosubsystem)
16 PerlInterpreter *my_perl;
17 struct perl_thread *thr;
19 #ifdef PERL_GLOBAL_STRUCT
20 #define PERLVAR(var,type) /**/
21 #define PERLVARI(var,type,init) PL_Vars.var = init;
22 #define PERLVARIC(var,type,init) PL_Vars.var = init;
29 PERL_SYS_INIT(&argc,&argv);
31 if (!(my_perl = perl_alloc()))
33 perl_construct( my_perl );
34 PL_perl_destruct_level = 0;
36 exitstatus = perl_parse(my_perl, xs_init, argc, argv, env);
38 exitstatus = perl_run( my_perl );
41 perl_destruct( my_perl );
49 extern HANDLE w32_perldll_handle;
52 DllMain(HANDLE hModule, /* DLL module handle */
53 DWORD fdwReason, /* reason called */
54 LPVOID lpvReserved) /* reserved */
57 /* The DLL is attaching to a process due to process
58 * initialization or a call to LoadLibrary.
60 case DLL_PROCESS_ATTACH:
61 /* #define DEFAULT_BINMODE */
62 #ifdef DEFAULT_BINMODE
63 setmode( fileno( stdin ), O_BINARY );
64 setmode( fileno( stdout ), O_BINARY );
65 setmode( fileno( stderr ), O_BINARY );
68 w32_perldll_handle = hModule;
71 /* The DLL is detaching from a process due to
72 * process termination or call to FreeLibrary.
74 case DLL_PROCESS_DETACH:
77 /* The attached process creates a new thread. */
78 case DLL_THREAD_ATTACH:
81 /* The thread of the attached process terminates. */
82 case DLL_THREAD_DETACH:
91 /* Register any extra external extensions */
93 char *staticlinkmodules[] = {
98 EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
103 char *file = __FILE__;
105 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);