2 * "The Road goes ever on and on, down from the door where it began."
10 static void xs_init _((void));
12 __declspec(dllexport) int
13 RunPerl(int argc, char **argv, char **env, void *iosubsystem)
16 PerlInterpreter *my_perl;
18 #ifdef PERL_GLOBAL_STRUCT
19 #define PERLVAR(var,type) /**/
20 #define PERLVARI(var,type,init) Perl_Vars.var = init;
26 PERL_SYS_INIT(&argc,&argv);
28 perl_init_i18nl10n(1);
30 if (!(my_perl = perl_alloc()))
32 perl_construct( my_perl );
33 perl_destruct_level = 0;
35 exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
37 exitstatus = perl_run( my_perl );
40 perl_destruct( my_perl );
48 extern HANDLE PerlDllHandle;
51 DllMain(HANDLE hModule, /* DLL module handle */
52 DWORD fdwReason, /* reason called */
53 LPVOID lpvReserved) /* reserved */
56 /* The DLL is attaching to a process due to process
57 * initialization or a call to LoadLibrary.
59 case DLL_PROCESS_ATTACH:
60 /* #define DEFAULT_BINMODE */
61 #ifdef DEFAULT_BINMODE
62 setmode( fileno( stdin ), O_BINARY );
63 setmode( fileno( stdout ), O_BINARY );
64 setmode( fileno( stderr ), O_BINARY );
67 PerlDllHandle = hModule;
70 /* The DLL is detaching from a process due to
71 * process termination or call to FreeLibrary.
73 case DLL_PROCESS_DETACH:
76 /* The attached process creates a new thread. */
77 case DLL_THREAD_ATTACH:
80 /* The thread of the attached process terminates. */
81 case DLL_THREAD_DETACH:
90 /* Register any extra external extensions */
92 char *staticlinkmodules[] = {
97 EXTERN_C void boot_DynaLoader _((CV* cv));
102 char *file = __FILE__;
104 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);