diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-04-17 00:00:00 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-17 00:00:00 +0000 |
commit | 96e4d5b14cf2dfb0235faa8bc3f701c15b15bb05 (patch) | |
tree | 573ae82e0e6a92c453a5b5cec1b10dc2f99362fe /win32 | |
parent | 6877a1cf6ff3f0f711772ea75e579e2e7219cc46 (diff) | |
download | perl-96e4d5b14cf2dfb0235faa8bc3f701c15b15bb05.tar.gz |
[inseparable changes from match from perl-5.003_97e to perl-5.003_97f]
CORE LANGUAGE CHANGES
Subject: New operator systell()
From: Chip Salzenberg <chip@perl.com>
Files: doio.c ext/Opcode/Opcode.pm keywords.pl opcode.pl pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pp_sys.c t/op/sysio.t toke.c
Subject: Allow constant sub to be optimized when called with parens
From: Chip Salzenberg <chip@perl.com>
Files: toke.c
Subject: Make {,un}pack fail on invalid pack types
From: Chip Salzenberg <chip@perl.com>
Files: pod/perldiag.pod pp.c
CORE PORTABILITY
Subject: Fix bitwise ops and {,un}pack() on Cray CPUs
From: Chip Salzenberg <chip@perl.com>
Files: pp.c
Subject: VMS update
From: Charles Bailey <bailey@hmivax.humgen.upenn.edu>
Files: lib/Cwd.pm lib/File/Path.pm lib/FindBin.pm vms/perly_c.vms vms/vms.c vms/writemain.pl
Subject: Win32 update (three patches)
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: lib/Cwd.pm lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MM_Win32.pm lib/File/Basename.pm win32/Makefile win32/makedef.pl win32/perllib.c win32/win32.c win32/win32iop.h
DOCUMENTATION
Subject: Document size restrictions for packed integers
From: Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi>
Files: pod/perlfunc.pod
LIBRARY AND EXTENSIONS
Subject: Fix bug in Opcode when (maxo & 15) > 8
From: Chip Salzenberg <chip@perl.com>
Files: ext/Opcode/Makefile.PL ext/Opcode/Opcode.pm ext/Opcode/Opcode.xs
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 4 | ||||
-rw-r--r-- | win32/makedef.pl | 13 | ||||
-rw-r--r-- | win32/perllib.c | 24 | ||||
-rw-r--r-- | win32/win32.c | 27 | ||||
-rw-r--r-- | win32/win32iop.h | 2 |
5 files changed, 64 insertions, 6 deletions
diff --git a/win32/Makefile b/win32/Makefile index 0e7068fa6d..50051815b3 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -48,12 +48,12 @@ OPTIMIZE = -Od $(RUNTIME) -Z7 -D "_DEBUG" ! ELSE OPTIMIZE = -Od $(RUNTIME)d -Z7 -D "_DEBUG" ! ENDIF -LINK_DBG = -pdb:$(*B).pdb +LINK_DBG = -debug -pdb:none !ELSE ! IF "$(CCTYPE)" == "MSVC20" OPTIMIZE = -Od $(RUNTIME) -D "NDEBUG" ! ELSE -OPTIMIZE = -O2 $(RUNTIME) -D "NDEBUG" +OPTIMIZE = -Od $(RUNTIME) -D "NDEBUG" ! ENDIF LINK_DBG = -release !ENDIF diff --git a/win32/makedef.pl b/win32/makedef.pl index 0d510aedcd..5237676b6c 100644 --- a/win32/makedef.pl +++ b/win32/makedef.pl @@ -208,17 +208,18 @@ perl_call_pv perl_call_method perl_call_sv perl_requirepv -win32_stat win32_errno -win32_stderr +win32_environ win32_stdin win32_stdout +win32_stderr win32_ferror win32_feof win32_strerror win32_fprintf win32_printf win32_vfprintf +win32_vprintf win32_fread win32_fwrite win32_fopen @@ -240,14 +241,18 @@ win32_rewind win32_tmpfile win32_abort win32_fstat +win32_stat win32_pipe win32_popen win32_pclose win32_setmode -win32_open -win32_close +win32_lseek +win32_tell win32_dup win32_dup2 +win32_open +win32_close +win32_eof win32_read win32_write win32_spawnvpe diff --git a/win32/perllib.c b/win32/perllib.c index 9d24a2ac18..43d84c507b 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -8,6 +8,7 @@ extern "C" { #include "EXTERN.h" #include "perl.h" +#include "XSUB.h" #ifdef __cplusplus } @@ -60,12 +61,35 @@ char *staticlinkmodules[] = { EXTERN_C void boot_DynaLoader _((CV* cv)); +static +XS(w32_GetCurrentDirectory) +{ + dXSARGS; + SV *sv = sv_newmortal(); + /* Make one call with zero size - return value is required size */ + DWORD len = GetCurrentDirectory((DWORD)0,NULL); + SvUPGRADE(sv,SVt_PV); + SvGROW(sv,len); + SvCUR(sv) = GetCurrentDirectory((DWORD) SvLEN(sv), SvPVX(sv)); + /* + * If result != 0 + * then it worked, set PV valid, + * else leave it 'undef' + */ + if (SvCUR(sv)) + SvPOK_on(sv); + EXTEND(sp,1); + ST(0) = sv; + XSRETURN(1); +} + static void xs_init() { char *file = __FILE__; dXSUB_SYS; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); + newXS("Win32::GetCurrentDirectory", w32_GetCurrentDirectory, file); } extern HANDLE PerlDllHandle; diff --git a/win32/win32.c b/win32/win32.c index 909036477d..ee50147538 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -841,6 +841,12 @@ win32_vfprintf(FILE *fp, const char *format, va_list args) return (pIOSubSystem->pfnvfprintf(fp, format, args)); } +DllExport int +win32_vprintf(const char *format, va_list args) +{ + return (pIOSubSystem->pfnvprintf(format, args)); +} + DllExport size_t win32_fread(void *buf, size_t size, size_t count, FILE *fp) { @@ -998,6 +1004,18 @@ win32_setmode(int fd, int mode) return pIOSubSystem->pfnsetmode(fd, mode); } +DllExport long +win32_lseek(int fd, long offset, int origin) +{ + return pIOSubSystem->pfnlseek(fd, offset, origin); +} + +DllExport long +win32_tell(int fd) +{ + return pIOSubSystem->pfntell(fd); +} + DllExport int win32_open(const char *path, int flag, ...) { @@ -1020,6 +1038,12 @@ win32_close(int fd) } DllExport int +win32_eof(int fd) +{ + return pIOSubSystem->pfneof(fd); +} + +DllExport int win32_dup(int fd) { return pIOSubSystem->pfndup(fd); @@ -1048,16 +1072,19 @@ win32_mkdir(const char *dir, int mode) { return pIOSubSystem->pfnmkdir(dir); /* just ignore mode */ } + DllExport int win32_rmdir(const char *dir) { return pIOSubSystem->pfnrmdir(dir); } + DllExport int win32_chdir(const char *dir) { return pIOSubSystem->pfnchdir(dir); } + DllExport int win32_spawnvpe(int mode, const char *cmdname, const char *const *argv, const char *const *envp) diff --git a/win32/win32iop.h b/win32/win32iop.h index eadc08f812..f630000630 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -21,6 +21,7 @@ EXT char* win32_strerror(int e); EXT int win32_fprintf(FILE *pf, const char *format, ...); EXT int win32_printf(const char *format, ...); EXT int win32_vfprintf(FILE *pf, const char *format, va_list arg); +EXT int win32_vprintf(const char *format, va_list arg); EXT size_t win32_fread(void *buf, size_t size, size_t count, FILE *pf); EXT size_t win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf); EXT FILE* win32_fopen(const char *path, const char *mode); @@ -100,6 +101,7 @@ void * SetIOSubSystem(void *piosubsystem); #define fprintf win32_fprintf #define vfprintf win32_vfprintf #define printf win32_printf +#define vprintf win32_vprintf #define fread(buf,size,count,f) win32_fread(buf,size,count,f) #define fwrite(buf,size,count,f) win32_fwrite(buf,size,count,f) #define fopen win32_fopen |