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);
33 if (!(my_perl = perl_alloc()))
35 perl_construct( my_perl );
36 PL_perl_destruct_level = 0;
38 exitstatus = perl_parse(my_perl, xs_init, argc, argv, env);
40 exitstatus = perl_run( my_perl );
43 perl_destruct( my_perl );
51 extern HANDLE w32_perldll_handle;
54 DllMain(HANDLE hModule, /* DLL module handle */
55 DWORD fdwReason, /* reason called */
56 LPVOID lpvReserved) /* reserved */
59 /* The DLL is attaching to a process due to process
60 * initialization or a call to LoadLibrary.
62 case DLL_PROCESS_ATTACH:
63 /* #define DEFAULT_BINMODE */
64 #ifdef DEFAULT_BINMODE
65 setmode( fileno( stdin ), O_BINARY );
66 setmode( fileno( stdout ), O_BINARY );
67 setmode( fileno( stderr ), O_BINARY );
70 w32_perldll_handle = hModule;
73 /* The DLL is detaching from a process due to
74 * process termination or call to FreeLibrary.
76 case DLL_PROCESS_DETACH:
79 /* The attached process creates a new thread. */
80 case DLL_THREAD_ATTACH:
83 /* The thread of the attached process terminates. */
84 case DLL_THREAD_DETACH:
93 /* Register any extra external extensions */
95 char *staticlinkmodules[] = {
100 EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
105 char *file = __FILE__;
107 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);