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;
19 MUTEX_INIT(&malloc_mutex);
22 PERL_SYS_INIT(&argc,&argv);
24 perl_init_i18nl10n(1);
26 if (!(my_perl = perl_alloc()))
28 perl_construct( my_perl );
29 perl_destruct_level = 0;
31 exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
33 exitstatus = perl_run( my_perl );
36 perl_destruct( my_perl );
44 extern HANDLE PerlDllHandle;
47 DllMain(HANDLE hModule, /* DLL module handle */
48 DWORD fdwReason, /* reason called */
49 LPVOID lpvReserved) /* reserved */
52 /* The DLL is attaching to a process due to process
53 * initialization or a call to LoadLibrary.
55 case DLL_PROCESS_ATTACH:
56 /* #define DEFAULT_BINMODE */
57 #ifdef DEFAULT_BINMODE
58 setmode( fileno( stdin ), O_BINARY );
59 setmode( fileno( stdout ), O_BINARY );
60 setmode( fileno( stderr ), O_BINARY );
63 PerlDllHandle = hModule;
66 /* The DLL is detaching from a process due to
67 * process termination or call to FreeLibrary.
69 case DLL_PROCESS_DETACH:
72 /* The attached process creates a new thread. */
73 case DLL_THREAD_ATTACH:
76 /* The thread of the attached process terminates. */
77 case DLL_THREAD_DETACH:
86 /* Register any extra external extensions */
88 char *staticlinkmodules[] = {
93 EXTERN_C void boot_DynaLoader _((CV* cv));
98 char *file = __FILE__;
100 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);