summaryrefslogtreecommitdiff
path: root/win32/perllib.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-01-29 18:11:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-29 18:11:00 +1200
commit0a753a764065f2260004b6e6975085378b850346 (patch)
treee5163ab53209cc4bf655cabaf4067f18036a9106 /win32/perllib.c
parent4b094ceb80288fc9f7c15ae78fc662051510284d (diff)
downloadperl-0a753a764065f2260004b6e6975085378b850346.tar.gz
[inseparable changes from patch from perl5.003_23 to perl5.003_24]perl-5.003_24
CORE LANGUAGE CHANGES Subject: glob defaults to $_ Date: Mon, 27 Jan 1997 03:09:13 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: op.c opcode.pl pod/perlfunc.pod t/op/glob.t private-msgid: <199701270809.DAA00934@aatma.engin.umich.edu> Subject: Re: an overloading bug Date: Sun, 26 Jan 1997 19:07:45 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: pod/perldiag.pod pod/perlfunc.pod pp_ctl.c private-msgid: <199701270007.TAA26525@aatma.engin.umich.edu> CORE PORTABILITY Subject: Win32 port From: Gary Ng <71564.1743@compuserve.com> Files: MANIFEST win32/* Subject: Amiga files Date: Sun, 26 Jan 1997 17:42:15 +0100 From: Norbert Pueschel <pueschel@imsdd.meb.uni-bonn.de> Files: MANIFEST README.amiga hints/amigaos.sh private-msgid: <77724712@Armageddon.meb.uni-bonn.de> DOCUMENTATION Subject: perldelta Fcntl enhancement Date: Sat, 25 Jan 1997 17:05:34 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perldelta.pod private-msgid: <199701251505.RAA22159@alpha.hut.fi> Subject: Updates to perldelta re: Fcntl, DB_File, Net::Ping From: Paul Marquess <pmarquess@bfsec.bt.co.uk> Files: pod/perldelta.pod Subject: Document restrictions on gv_fetchmethod() and perl_call_sv() From: Chip Salzenberg <chip@atlantic.net> Files: pod/perldelta.pod pod/perlguts.pod Subject: perldiag.pod: No comma allowed after %s Date: Sat, 25 Jan 1997 17:41:53 +0200 (EET) From: Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi> Files: pod/perldiag.pod private-msgid: <199701251541.RAA04120@alpha.hut.fi> Subject: perlfunc.pod: localtime Date: Sat, 25 Jan 1997 18:29:37 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perlfunc.pod private-msgid: <199701251629.SAA08114@alpha.hut.fi> Subject: perlfunc diff: gmtime Date: Tue, 28 Jan 1997 14:52:08 +0000 From: Peter Haworth <pmh@edison.ioppublishing.com> Files: pod/perlfunc.pod private-msgid: <32EE1298.7B90@edison.ioppublishing.com> Subject: Updates to guts Date: Sun, 26 Jan 1997 19:34:18 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: pod/perlguts.pod private-msgid: <199701270034.TAA13177@monk.mps.ohio-state.edu> TESTS Subject: New test op/closure.t From: Tom Phoenix <rootbeer@teleport.com> Files: MANIFEST t/op/closure.t
Diffstat (limited to 'win32/perllib.c')
-rw-r--r--win32/perllib.c120
1 files changed, 120 insertions, 0 deletions
diff --git a/win32/perllib.c b/win32/perllib.c
new file mode 100644
index 0000000000..f35d41c8bf
--- /dev/null
+++ b/win32/perllib.c
@@ -0,0 +1,120 @@
+#ifdef ABC
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <io.h>
+#endif
+
+/*
+ * "The Road goes ever on and on, down from the door where it began."
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EXTERN.h"
+#include "perl.h"
+
+#ifdef __cplusplus
+}
+# define EXTERN_C extern "C"
+#else
+# define EXTERN_C extern
+#endif
+
+static void xs_init _((void));
+
+__declspec(dllexport) int RunPerl(int argc, char **argv, char **env, void *iosubsystem)
+{
+ int exitstatus;
+ PerlInterpreter *my_perl;
+ void *pOldIOSubsystem;
+
+ pOldIOSubsystem = SetIOSubSystem(iosubsystem);
+
+ PERL_SYS_INIT(&argc,&argv);
+
+ perl_init_i18nl10n(1);
+
+ if (!(my_perl = perl_alloc())) return (1);
+ perl_construct( my_perl );
+ perl_destruct_level = 0;
+
+
+ exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
+ if (!exitstatus) {
+ exitstatus = perl_run( my_perl );
+ }
+
+
+ perl_destruct( my_perl );
+ perl_free( my_perl );
+
+ PERL_SYS_TERM();
+
+ SetIOSubSystem(pOldIOSubsystem);
+
+ return (exitstatus);
+}
+
+/* Register any extra external extensions */
+
+char *staticlinkmodules[]={
+ "DynaLoader",
+ NULL,
+ };
+
+EXTERN_C void boot_DynaLoader _((CV* cv));
+
+static void
+xs_init()
+{
+ dXSUB_SYS;
+ char *file = __FILE__;
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+}
+
+extern HANDLE PerlDllHandle;
+
+BOOL APIENTRY DllMain(HANDLE hModule, // DLL module handle
+ DWORD fdwReason, // reason called
+ LPVOID lpvReserved) // reserved
+{
+ switch (fdwReason)
+ {
+ // The DLL is attaching to a process due to process
+ // initialization or a call to LoadLibrary.
+ case DLL_PROCESS_ATTACH:
+//#define DEFAULT_BINMODE
+#ifdef DEFAULT_BINMODE
+ _setmode( _fileno( stdin ), _O_BINARY );
+ _setmode( _fileno( stdout ), _O_BINARY );
+ _setmode( _fileno( stderr ), _O_BINARY );
+ _fmode = _O_BINARY;
+#endif
+
+ PerlDllHandle = hModule;
+ break;
+
+ // The DLL is detaching from a process due to
+ // process termination or call to FreeLibrary.
+ case DLL_PROCESS_DETACH:
+ break;
+
+ // The attached process creates a new thread.
+ case DLL_THREAD_ATTACH:
+ break;
+
+ // The thread of the attached process terminates.
+ case DLL_THREAD_DETACH:
+ break;
+
+ default:
+ break;
+ }
+ return TRUE;
+}
+