home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
perl
/
update.dif
< prev
next >
Wrap
Text File
|
1991-06-17
|
15KB
|
573 lines
diff -cbBwr perl-4.010/eval.c perl4010/eval.c
*** perl-4.010/eval.c Tue Jun 11 23:33:24 1991
--- perl4010/eval.c Wed Jun 12 00:00:16 1991
***************
*** 34,39 ****
--- 34,44 ----
#ifdef I_FCNTL
#include <fcntl.h>
#endif
+ #ifdef MSDOS
+ /* I_FCNTL *MUST* not be defined for MS-DOS and OS/2
+ but fcntl.h is required for O_BINARY */
+ #include <fcntl.h>
+ #endif
#ifdef I_SYS_FILE
#include <sys/file.h>
#endif
diff -cbBwr perl-4.010/os2/a2p.cs perl4010/os2/a2p.cs
*** perl-4.010/os2/a2p.cs Wed Mar 20 08:47:00 1991
--- perl4010/os2/a2p.cs Mon Jun 17 08:44:00 1991
***************
*** 2,8 ****
(-W1 -Od -Ocgelt hash.c str.c util.c walk.c)
setargv.obj
! ..\os2\a2p.def
a2p.exe
-AL -LB -S0x9000
--- 2,9 ----
(-W1 -Od -Ocgelt hash.c str.c util.c walk.c)
setargv.obj
!
! ..\os2\perl.def
a2p.exe
-AL -LB -S0x9000
diff -cbBwr perl-4.010/os2/eg/alarm.pl perl4010/os2/eg/alarm.pl
*** perl-4.010/os2/eg/alarm.pl Wed Mar 20 08:49:04 1991
--- perl4010/os2/eg/alarm.pl Mon Jun 17 00:08:18 1991
***************
*** 4,12 ****
exit(0);
}
- $SIG{'INT'} = 'handler';
- $SIG{'QUIT'} = 'handler';
$SIG{'ALRM'} = 'handler';
print "Starting execution ...\n";
alarm(10);
--- 4,14 ----
exit(0);
}
$SIG{'ALRM'} = 'handler';
+
+ $SIG{'INT'} = 'handler'; # Ctrl-C pressed
+ $SIG{'BREAK'} = 'handler'; # Ctrl-Break pressed
+ $SIG{'TERM'} = 'handler'; # Killed by another process
print "Starting execution ...\n";
alarm(10);
diff -cbBwr perl-4.010/os2/glob.c perl4010/os2/glob.c
*** perl-4.010/os2/glob.c Wed Mar 20 08:49:00 1991
--- perl4010/os2/glob.c Mon Jun 17 10:49:22 1991
***************
*** 1,18 ****
/*
* Globbing for OS/2. Relies on the expansion done by the library
! * startup code. (dds)
*/
! #include <stdio.h>
! #include <string.h>
! main(int argc, char *argv[])
{
! register i;
for (i = 1; i < argc; i++)
{
! fputs(IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i], stdout);
! putchar(0);
}
}
--- 1,22 ----
/*
* Globbing for OS/2. Relies on the expansion done by the library
! * startup code.
*/
! #define PERLGLOB
! #include "director.c"
! int main(int argc, char **argv)
{
! SHORT i;
! USHORT r;
! CHAR *f;
for (i = 1; i < argc; i++)
{
! f = IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i];
! DosWrite(1, f, strlen(f) + 1, &r);
}
+
+ return argc - 1;
}
diff -cbBwr perl-4.010/os2/os2.c perl4010/os2/os2.c
*** perl-4.010/os2/os2.c Tue Jun 11 23:34:18 1991
--- perl4010/os2/os2.c Sun Jun 16 20:17:16 1991
***************
*** 54,67 ****
{ return -1; }
! /* extendd chdir() */
int chdir(char *path)
{
if ( path[0] != 0 && path[1] == ':' )
! DosSelectDisk(toupper(path[0]) - '@');
! DosChDir(path, 0L);
}
--- 54,68 ----
{ return -1; }
! /* extended chdir() */
int chdir(char *path)
{
if ( path[0] != 0 && path[1] == ':' )
! if ( DosSelectDisk(toupper(path[0]) - '@') )
! return -1;
! return DosChDir(path, 0L);
}
***************
*** 102,107 ****
--- 103,124 ----
}
+ /* wait for specific pid */
+
+ int wait4pid(int pid, int *status, int flags)
+ {
+ RESULTCODES res;
+ int endpid, rc;
+
+ if ( DosCwait(DCWA_PROCESS, flags ? DCWW_NOWAIT : DCWW_WAIT,
+ &res, &endpid, pid) )
+ return -1;
+
+ *status = res.codeResult;
+ return endpid;
+ }
+
+
/* kill */
int kill(int pid, int sig)
***************
*** 251,257 ****
usage(char *myname)
{
#ifdef MSDOS
! printf("\nUsage: %s [-acdnpsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
#else
printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
#endif
--- 268,274 ----
usage(char *myname)
{
#ifdef MSDOS
! printf("\nUsage: %s [-acdnpPsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
#else
printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
#endif
***************
*** 262,270 ****
"\n -d run scripts under debugger"
"\n -n assume 'while (<>) { ...script... }' loop arround your script"
"\n -p assume loop like -n but print line also like sed"
- #ifndef MSDOS
"\n -P run script through C preprocessor befor compilation"
- #endif
"\n -s enable some switch parsing for switches after script name"
"\n -S look for the script using PATH environment variable");
#ifndef MSDOS
--- 279,285 ----
diff -cbBwr perl-4.010/os2/perl.cs perl4010/os2/perl.cs
*** perl-4.010/os2/perl.cs Wed Mar 20 08:48:50 1991
--- perl4010/os2/perl.cs Mon Jun 17 08:44:00 1991
***************
*** 1,15 ****
(-W1 -Od -Olt -DDEBUGGING -Gt2048
array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c form.c
! hash.c perl.c perly.c regcomp.c regexec.c stab.c str.c util.c
)
! (-W1 -Od -Olt -B2C2L -B3C3L -DDEBUGGING eval.c{evalargs.xc} toke.c)
(-W1 -Od -Olt -I. -Ios2
! os2\os2.c os2\popen.c os2\mktemp.c os2\director.c os2\suffix.c os2\alarm.c
)
; link with this library if you have GNU gdbm for OS/2
! ; remember to enable the NDBM symbol in config.h before compiling
lgdbm.lib
setargv.obj
os2\perl.def
os2\perl.bad
--- 1,18 ----
(-W1 -Od -Olt -DDEBUGGING -Gt2048
array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c form.c
! hash.c perl.c regcomp.c regexec.c stab.c str.c util.c
)
! (-W1 -Od -Olt -DDEBUGGING -Gt2048 (-d perly.y))
! (-W1 -Od -Olt -B2C2L -B3C3L -DDEBUGGING eval.c toke.c)
(-W1 -Od -Olt -I. -Ios2
! os2\os2.c os2\popen.c os2\suffix.c
! os2\director.c os2\alarm.c os2\crypt.c
)
; link with this library if you have GNU gdbm for OS/2
! ; remember to enable the GDBM symbol in config.h before compiling
lgdbm.lib
+
setargv.obj
os2\perl.def
os2\perl.bad
diff -cbBwr perl-4.010/os2/perl.def perl4010/os2/perl.def
*** perl-4.010/os2/perl.def Wed Mar 20 08:47:20 1991
--- perl4010/os2/perl.def Mon Jun 17 08:45:00 1991
***************
*** 1,2 ****
! NAME PERL WINDOWCOMPAT NEWFILES
! DESCRIPTION 'PERL 3.0 - for MS-DOS and OS/2'
--- 1,2 ----
! NAME WINDOWCOMPAT NEWFILES
! DESCRIPTION 'PERL 4.0 - for MS-DOS and OS/2'
diff -cbBwr perl-4.010/os2/perlglob.cs perl4010/os2/perlglob.cs
*** perl-4.010/os2/perlglob.cs Wed Mar 20 08:49:04 1991
--- perl4010/os2/perlglob.cs Mon Jun 17 08:50:12 1991
***************
*** 1,9 ****
os2\glob.c
- (-DPERLGLOB os2\director.c)
setargv.obj
! os2\perlglob.def
! os2\perlglob.bad
perlglob.exe
-AS -LB -S0x1000
--- 1,9 ----
os2\glob.c
setargv.obj
!
! os2\perl.def
! os2\perl.bad
perlglob.exe
-AS -LB -S0x1000
diff -cbBwr perl-4.010/os2/popen.c perl4010/os2/popen.c
*** perl-4.010/os2/popen.c Wed Mar 20 08:47:54 1991
--- perl4010/os2/popen.c Sun Jun 16 20:17:02 1991
***************
*** 65,71 ****
if ( _osmode == DOS_MODE )
return dos_popen(cmd, mode);
! if (DosMakePipe((PHFILE) &p[0], (PHFILE) &p[1], 4096) < 0)
return NULL;
myside = tst(p[WRITEH], p[READH]);
--- 65,71 ----
if ( _osmode == DOS_MODE )
return dos_popen(cmd, mode);
! if ( _pipe(p, 4096, 0) )
return NULL;
myside = tst(p[WRITEH], p[READH]);
***************
*** 124,130 ****
{
int res;
! if ( res = DosMakePipe((PHFILE) &filedes[0], (PHFILE) &filedes[1], 4096) )
return res;
DosSetFHandState(filedes[0], OPEN_FLAGS_NOINHERIT);
--- 124,130 ----
{
int res;
! if ( res = _pipe(filedes, 4096, 0) )
return res;
DosSetFHandState(filedes[0], OPEN_FLAGS_NOINHERIT);
***************
*** 149,154 ****
--- 150,156 ----
{
FILE *current;
char name[128];
+ char *tmp = getenv("TMP");
int cur;
pipemode curmode;
***************
*** 165,172 ****
/*
** get a name to use.
*/
! strcpy(name, "piXXXXXX");
! Mktemp(name);
/*
** If we're reading, just call system to get a file filled with
--- 167,177 ----
/*
** get a name to use.
*/
! strcpy(name, tmp ? tmp : "\\");
! if ( name[strlen(name) - 1] != '\\' )
! strcat(name, "\\");
! strcat(name, "piXXXXXX");
! mktemp(name);
/*
** If we're reading, just call system to get a file filled with
diff -cbBwr perl-4.010/os2/README.OS2 perl4010/os2/README.OS2
*** perl-4.010/os2/README.OS2 Wed Mar 20 08:46:26 1991
--- perl4010/os2/README.OS2 Mon Jun 17 00:27:52 1991
***************
*** 404,406 ****
--- 404,436 ----
Kai Uwe Rommel
rommel@lan.informatik.tu-muenchen.dbp.de
+
+
+ Verified perl 4.0 at patchlevel 10
+ Changes:
+ - some minor corrections and updates in various files
+ - new os2/config.h created from original config.H
+ - added support for crypt(), PD routine by A.Tanenbaum in new os2/crypt.c
+ - added support for wait4pid() in os2.c
+ - fixed/added support for -P option (requires a standard CPP for OS/2)
+ - os2/mktemp.c deleted, no longer needed
+ - new Makefile created for MS C 6.00 and it's NMAKE
+ - with os2/perl.cs, bison has no longer to be called manually
+
+ I have successfully run most tests. Diffs are in os2/tests.dif.
+ Often, only command names, shell expansion etc. have to be changed.
+ Test that still don't run are Unix-specific ones or fail because
+ of CR/LF-problems:
+
+ - io/argv.t, io/inplace.t, op/exec.t, op/glob.t (minor problems)
+ - io/fs.t, io/pipe.t op/fork.t, op/magic.t, op/time.t
+ (under OS/2 not supported features of Unix)
+ - op/pat.t (bug, not yet fixed)
+
+ Remember to remove the HAS_GDBM symbol from os2/config.h or
+ get GNU gdbm for OS/2.
+
+ June 1991
+
+ Kai Uwe Rommel
+ rommel@lan.informatik.tu-muenchen.dbp.de
diff -cbBwr perl-4.010/perl.c perl4010/perl.c
*** perl-4.010/perl.c Tue Jun 11 23:37:02 1991
--- perl4010/perl.c Sun Jun 16 20:28:02 1991
***************
*** 29,39 ****
#include "EXTERN.h"
#include "perl.h"
#include "perly.h"
- #ifdef MSDOS
- #include "patchlev.h"
- #else
#include "patchlevel.h"
- #endif
char *getenv();
--- 29,35 ----
***************
*** 321,328 ****
if (preprocess) {
str_cat(str,"-I");
str_cat(str,PRIVLIB);
(void)sprintf(buf, "\
! %ssed %s -e '/^[^#]/b' \
-e '/^#[ ]*include[ ]/b' \
-e '/^#[ ]*define[ ]/b' \
-e '/^#[ ]*if[ ]/b' \
--- 317,338 ----
if (preprocess) {
str_cat(str,"-I");
str_cat(str,PRIVLIB);
+ #ifdef MSDOS
+ (void)sprintf(buf, "\
+ sed %s -e \"/^[^#]/b\" \
+ -e \"/^#[ ]*include[ ]/b\" \
+ -e \"/^#[ ]*define[ ]/b\" \
+ -e \"/^#[ ]*if[ ]/b\" \
+ -e \"/^#[ ]*ifdef[ ]/b\" \
+ -e \"/^#[ ]*ifndef[ ]/b\" \
+ -e \"/^#[ ]*else/b\" \
+ -e \"/^#[ ]*endif/b\" \
+ -e \"s/^#.*//\" \
+ %s | %s -C %s %s",
+ (doextract ? "-e \"1,/^#/d\n\"" : ""),
+ #else
(void)sprintf(buf, "\
! /bin/sed %s -e '/^[^#]/b' \
-e '/^#[ ]*include[ ]/b' \
-e '/^#[ ]*define[ ]/b' \
-e '/^#[ ]*if[ ]/b' \
***************
*** 332,343 ****
-e '/^#[ ]*endif/b' \
-e 's/^#.*//' \
%s | %s -C %s %s",
- #ifdef MSDOS
- "",
- #else
- "/bin/",
- #endif
(doextract ? "-e '1,/^#/d\n'" : ""),
argv[0], CPPSTDIN, str_get(str), CPPMINUS);
#ifdef DEBUGGING
if (debug & 64) {
--- 342,349 ----
-e '/^#[ ]*endif/b' \
-e 's/^#.*//' \
%s | %s -C %s %s",
(doextract ? "-e '1,/^#/d\n'" : ""),
+ #endif
argv[0], CPPSTDIN, str_get(str), CPPMINUS);
#ifdef DEBUGGING
if (debug & 64) {
***************
*** 1197,1203 ****
fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
stdout);
#ifdef OS2
! fputs("OS/2 port Copyright (c) 1990, Raymond Chen, Kai Uwe Rommel\n",
stdout);
#endif
#endif
--- 1203,1209 ----
fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
stdout);
#ifdef OS2
! fputs("OS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n",
stdout);
#endif
#endif
diff -cbBwr perl-4.010/util.c perl4010/util.c
*** perl-4.010/util.c Tue Jun 11 23:36:18 1991
--- perl4010/util.c Sun Jun 16 19:55:42 1991
***************
*** 1386,1391 ****
--- 1386,1392 ----
#endif
#endif
}
+ #endif /* !MSDOS */
pidgone(pid,status)
int pid;
***************
*** 1402,1408 ****
#endif
return;
}
- #endif /* !MSDOS */
#ifndef HAS_MEMCMP
memcmp(s1,s2,len)
--- 1403,1408 ----
diff -cbBwr perl-4.010/x2p/a2py.c perl4010/x2p/a2py.c
*** perl-4.010/x2p/a2py.c Tue Jun 11 23:32:12 1991
--- perl4010/x2p/a2py.c Fri Jun 14 23:49:24 1991
***************
*** 14,21 ****
*
*/
! #ifdef MSDOS
! #include "../patchlev.h"
#endif
#include "util.h"
char *index();
--- 14,21 ----
*
*/
! #ifdef OS2
! #include "../patchlevel.h"
#endif
#include "util.h"
char *index();
***************
*** 26,35 ****
int checkers = 0;
STR *walk();
! #ifdef MSDOS
usage()
{
! printf("\nThis is the AWK to PERL translator, version 3.0, patchlevel %d\n", PATCHLEVEL);
printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname);
printf("\n -D<number> sets debugging flags."
"\n -F<character> the awk script to translate is always invoked with"
--- 26,35 ----
int checkers = 0;
STR *walk();
! #ifdef OS2
usage()
{
! printf("\nThis is the AWK to PERL translator, version 4.0, patchlevel %d\n", PATCHLEVEL);
printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname);
printf("\n -D<number> sets debugging flags."
"\n -F<character> the awk script to translate is always invoked with"
***************
*** 85,91 ****
break;
default:
fatal("Unrecognized switch: %s\n",argv[0]);
! #ifdef MSDOS
usage();
#endif
}
--- 85,91 ----
break;
default:
fatal("Unrecognized switch: %s\n",argv[0]);
! #ifdef OS2
usage();
#endif
}
***************
*** 95,101 ****
/* open script */
if (argv[0] == Nullch) {
! #ifdef MSDOS
if ( isatty(fileno(stdin)) )
usage();
#endif
--- 95,101 ----
/* open script */
if (argv[0] == Nullch) {
! #ifdef OS2
if ( isatty(fileno(stdin)) )
usage();
#endif