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 PERL_SYS_INIT(&argc,&argv);
20 perl_init_i18nl10n(1);
22 if (!(my_perl = perl_alloc()))
24 perl_construct( my_perl );
25 perl_destruct_level = 0;
27 exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
29 exitstatus = perl_run( my_perl );
32 perl_destruct( my_perl );
40 extern HANDLE PerlDllHandle;
43 DllMain(HANDLE hModule, /* DLL module handle */
44 DWORD fdwReason, /* reason called */
45 LPVOID lpvReserved) /* reserved */
48 /* The DLL is attaching to a process due to process
49 * initialization or a call to LoadLibrary.
51 case DLL_PROCESS_ATTACH:
52 /* #define DEFAULT_BINMODE */
53 #ifdef DEFAULT_BINMODE
54 setmode( fileno( stdin ), O_BINARY );
55 setmode( fileno( stdout ), O_BINARY );
56 setmode( fileno( stderr ), O_BINARY );
59 PerlDllHandle = hModule;
62 /* The DLL is detaching from a process due to
63 * process termination or call to FreeLibrary.
65 case DLL_PROCESS_DETACH:
68 /* The attached process creates a new thread. */
69 case DLL_THREAD_ATTACH:
72 /* The thread of the attached process terminates. */
73 case DLL_THREAD_DETACH:
82 /* Register any extra external extensions */
84 char *staticlinkmodules[] = {
89 EXTERN_C void boot_DynaLoader _((CV* cv));
94 char *file = __FILE__;
96 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);