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;
17 void *pOldIOSubsystem;
19 pOldIOSubsystem = SetIOSubSystem(iosubsystem);
21 PERL_SYS_INIT(&argc,&argv);
23 perl_init_i18nl10n(1);
25 if (!(my_perl = perl_alloc()))
27 perl_construct( my_perl );
28 perl_destruct_level = 0;
30 exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
32 exitstatus = perl_run( my_perl );
35 perl_destruct( my_perl );
40 SetIOSubSystem(pOldIOSubsystem);
45 extern HANDLE PerlDllHandle;
48 DllMain(HANDLE hModule, /* DLL module handle */
49 DWORD fdwReason, /* reason called */
50 LPVOID lpvReserved) /* reserved */
53 /* The DLL is attaching to a process due to process
54 * initialization or a call to LoadLibrary.
56 case DLL_PROCESS_ATTACH:
57 /* #define DEFAULT_BINMODE */
58 #ifdef DEFAULT_BINMODE
59 setmode( fileno( stdin ), O_BINARY );
60 setmode( fileno( stdout ), O_BINARY );
61 setmode( fileno( stderr ), O_BINARY );
64 PerlDllHandle = hModule;
67 /* The DLL is detaching from a process due to
68 * process termination or call to FreeLibrary.
70 case DLL_PROCESS_DETACH:
73 /* The attached process creates a new thread. */
74 case DLL_THREAD_ATTACH:
77 /* The thread of the attached process terminates. */
78 case DLL_THREAD_DETACH:
87 /* Register any extra external extensions */
89 char *staticlinkmodules[] = {
94 EXTERN_C void boot_DynaLoader _((CV* cv));
99 char *file = __FILE__;
101 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);