2 * "The Road goes ever on and on, down from the door where it began."
10 static void xs_init _((void));
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) PL_Vars.var = init;
21 #define PERLVARIC(var,type,init) PL_Vars.var = init;
28 PERL_SYS_INIT(&argc,&argv);
30 perl_init_i18nl10n(1);
32 if (!(my_perl = perl_alloc()))
34 perl_construct( my_perl );
35 PL_perl_destruct_level = 0;
37 exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
39 exitstatus = perl_run( my_perl );
42 perl_destruct( my_perl );
50 extern HANDLE w32_perldll_handle;
53 DllMain(HANDLE hModule, /* DLL module handle */
54 DWORD fdwReason, /* reason called */
55 LPVOID lpvReserved) /* reserved */
58 /* The DLL is attaching to a process due to process
59 * initialization or a call to LoadLibrary.
61 case DLL_PROCESS_ATTACH:
62 /* #define DEFAULT_BINMODE */
63 #ifdef DEFAULT_BINMODE
64 setmode( fileno( stdin ), O_BINARY );
65 setmode( fileno( stdout ), O_BINARY );
66 setmode( fileno( stderr ), O_BINARY );
69 w32_perldll_handle = hModule;
72 /* The DLL is detaching from a process due to
73 * process termination or call to FreeLibrary.
75 case DLL_PROCESS_DETACH:
78 /* The attached process creates a new thread. */
79 case DLL_THREAD_ATTACH:
82 /* The thread of the attached process terminates. */
83 case DLL_THREAD_DETACH:
92 /* Register any extra external extensions */
94 char *staticlinkmodules[] = {
99 EXTERN_C void boot_DynaLoader _((CV* cv));
104 char *file = __FILE__;
106 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);