home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / perl / os2perl / update.dif < prev    next >
Text File  |  1991-06-17  |  15KB  |  573 lines

  1. diff -cbBwr perl-4.010/eval.c perl4010/eval.c
  2. *** perl-4.010/eval.c    Tue Jun 11 23:33:24 1991
  3. --- perl4010/eval.c    Wed Jun 12 00:00:16 1991
  4. ***************
  5. *** 34,39 ****
  6. --- 34,44 ----
  7.   #ifdef I_FCNTL
  8.   #include <fcntl.h>
  9.   #endif
  10. + #ifdef MSDOS
  11. + /* I_FCNTL *MUST* not be defined for MS-DOS and OS/2
  12. +    but fcntl.h is required for O_BINARY */
  13. + #include <fcntl.h>
  14. + #endif
  15.   #ifdef I_SYS_FILE
  16.   #include <sys/file.h>
  17.   #endif
  18. diff -cbBwr perl-4.010/os2/a2p.cs perl4010/os2/a2p.cs
  19. *** perl-4.010/os2/a2p.cs    Wed Mar 20 08:47:00 1991
  20. --- perl4010/os2/a2p.cs    Mon Jun 17 08:44:00 1991
  21. ***************
  22. *** 2,8 ****
  23.   (-W1 -Od -Ocgelt hash.c str.c util.c walk.c)
  24.   
  25.   setargv.obj
  26. ! ..\os2\a2p.def
  27.   a2p.exe
  28.   
  29.   -AL -LB -S0x9000
  30. --- 2,9 ----
  31.   (-W1 -Od -Ocgelt hash.c str.c util.c walk.c)
  32.   
  33.   setargv.obj
  34. ! ..\os2\perl.def
  35.   a2p.exe
  36.   
  37.   -AL -LB -S0x9000
  38. diff -cbBwr perl-4.010/os2/eg/alarm.pl perl4010/os2/eg/alarm.pl
  39. *** perl-4.010/os2/eg/alarm.pl    Wed Mar 20 08:49:04 1991
  40. --- perl4010/os2/eg/alarm.pl    Mon Jun 17 00:08:18 1991
  41. ***************
  42. *** 4,12 ****
  43.     exit(0);
  44.   }
  45.   
  46. - $SIG{'INT'} = 'handler';
  47. - $SIG{'QUIT'} = 'handler';
  48.   $SIG{'ALRM'} = 'handler';
  49.   
  50.   print "Starting execution ...\n";
  51.   alarm(10);
  52. --- 4,14 ----
  53.     exit(0);
  54.   }
  55.   
  56.   $SIG{'ALRM'} = 'handler';
  57. + $SIG{'INT'} = 'handler';    # Ctrl-C pressed
  58. + $SIG{'BREAK'} = 'handler';    # Ctrl-Break pressed
  59. + $SIG{'TERM'} = 'handler';    # Killed by another process
  60.   
  61.   print "Starting execution ...\n";
  62.   alarm(10);
  63. diff -cbBwr perl-4.010/os2/glob.c perl4010/os2/glob.c
  64. *** perl-4.010/os2/glob.c    Wed Mar 20 08:49:00 1991
  65. --- perl4010/os2/glob.c    Mon Jun 17 10:49:22 1991
  66. ***************
  67. *** 1,18 ****
  68.   /*
  69.    * Globbing for OS/2.  Relies on the expansion done by the library
  70. !  * startup code. (dds)
  71.    */
  72.   
  73. ! #include <stdio.h>
  74. ! #include <string.h>
  75.   
  76. ! main(int argc, char *argv[])
  77.   {
  78. !   register i;
  79.   
  80.     for (i = 1; i < argc; i++)
  81.     {
  82. !     fputs(IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i], stdout);
  83. !     putchar(0);
  84.     }
  85.   }
  86. --- 1,22 ----
  87.   /*
  88.    * Globbing for OS/2.  Relies on the expansion done by the library
  89. !  * startup code.
  90.    */
  91.   
  92. ! #define PERLGLOB
  93. ! #include "director.c"
  94.   
  95. ! int main(int argc, char **argv)
  96.   {
  97. !   SHORT i;
  98. !   USHORT r;
  99. !   CHAR *f;
  100.   
  101.     for (i = 1; i < argc; i++)
  102.     {
  103. !     f = IsFileSystemFAT(argv[i]) ? strlwr(argv[i]) : argv[i];
  104. !     DosWrite(1, f, strlen(f) + 1, &r);
  105.     }
  106. +   return argc - 1;
  107.   }
  108. diff -cbBwr perl-4.010/os2/os2.c perl4010/os2/os2.c
  109. *** perl-4.010/os2/os2.c    Tue Jun 11 23:34:18 1991
  110. --- perl4010/os2/os2.c    Sun Jun 16 20:17:16 1991
  111. ***************
  112. *** 54,67 ****
  113.   { return -1; }
  114.   
  115.   
  116. ! /* extendd chdir() */
  117.   
  118.   int chdir(char *path)
  119.   {
  120.     if ( path[0] != 0 && path[1] == ':' )
  121. !     DosSelectDisk(toupper(path[0]) - '@');
  122.   
  123. !   DosChDir(path, 0L);
  124.   }
  125.   
  126.   
  127. --- 54,68 ----
  128.   { return -1; }
  129.   
  130.   
  131. ! /* extended chdir() */
  132.   
  133.   int chdir(char *path)
  134.   {
  135.     if ( path[0] != 0 && path[1] == ':' )
  136. !     if ( DosSelectDisk(toupper(path[0]) - '@') )
  137. !       return -1;
  138.   
  139. !   return DosChDir(path, 0L);
  140.   }
  141.   
  142.   
  143. ***************
  144. *** 102,107 ****
  145. --- 103,124 ----
  146.   }
  147.   
  148.   
  149. + /* wait for specific pid */
  150. + int wait4pid(int pid, int *status, int flags)
  151. + {
  152. +   RESULTCODES res;
  153. +   int endpid, rc;
  154. +   if ( DosCwait(DCWA_PROCESS, flags ? DCWW_NOWAIT : DCWW_WAIT,
  155. +                 &res, &endpid, pid) )
  156. +     return -1;
  157. +   *status = res.codeResult;
  158. +   return endpid;
  159. + }
  160.   /* kill */
  161.   
  162.   int kill(int pid, int sig)
  163. ***************
  164. *** 251,257 ****
  165.   usage(char *myname)
  166.   {
  167.   #ifdef MSDOS
  168. !   printf("\nUsage: %s [-acdnpsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
  169.   #else
  170.     printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
  171.   #endif
  172. --- 268,274 ----
  173.   usage(char *myname)
  174.   {
  175.   #ifdef MSDOS
  176. !   printf("\nUsage: %s [-acdnpPsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
  177.   #else
  178.     printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
  179.   #endif
  180. ***************
  181. *** 262,270 ****
  182.            "\n  -d  run scripts under debugger"
  183.            "\n  -n  assume 'while (<>) { ...script... }' loop arround your script"
  184.            "\n  -p  assume loop like -n but print line also like sed"
  185. - #ifndef MSDOS
  186.            "\n  -P  run script through C preprocessor befor compilation"
  187. - #endif
  188.            "\n  -s  enable some switch parsing for switches after script name"
  189.            "\n  -S  look for the script using PATH environment variable");
  190.   #ifndef MSDOS
  191. --- 279,285 ----
  192. diff -cbBwr perl-4.010/os2/perl.cs perl4010/os2/perl.cs
  193. *** perl-4.010/os2/perl.cs    Wed Mar 20 08:48:50 1991
  194. --- perl4010/os2/perl.cs    Mon Jun 17 08:44:00 1991
  195. ***************
  196. *** 1,15 ****
  197.   (-W1 -Od -Olt -DDEBUGGING -Gt2048
  198.   array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c form.c
  199. ! hash.c perl.c perly.c regcomp.c regexec.c stab.c str.c util.c
  200.   )
  201. ! (-W1 -Od -Olt -B2C2L -B3C3L -DDEBUGGING eval.c{evalargs.xc} toke.c)
  202.   (-W1 -Od -Olt -I. -Ios2
  203. ! os2\os2.c os2\popen.c os2\mktemp.c os2\director.c os2\suffix.c os2\alarm.c
  204.   )
  205.   
  206.   ; link with this library if you have GNU gdbm for OS/2
  207. ! ; remember to enable the NDBM symbol in config.h before compiling
  208.   lgdbm.lib
  209.   setargv.obj
  210.   os2\perl.def
  211.   os2\perl.bad
  212. --- 1,18 ----
  213.   (-W1 -Od -Olt -DDEBUGGING -Gt2048
  214.   array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c form.c
  215. ! hash.c perl.c regcomp.c regexec.c stab.c str.c util.c
  216.   )
  217. ! (-W1 -Od -Olt -DDEBUGGING -Gt2048 (-d perly.y))
  218. ! (-W1 -Od -Olt -B2C2L -B3C3L -DDEBUGGING eval.c toke.c)
  219.   (-W1 -Od -Olt -I. -Ios2
  220. ! os2\os2.c os2\popen.c os2\suffix.c
  221. ! os2\director.c os2\alarm.c os2\crypt.c
  222.   )
  223.   
  224.   ; link with this library if you have GNU gdbm for OS/2
  225. ! ; remember to enable the GDBM symbol in config.h before compiling
  226.   lgdbm.lib
  227.   setargv.obj
  228.   os2\perl.def
  229.   os2\perl.bad
  230. diff -cbBwr perl-4.010/os2/perl.def perl4010/os2/perl.def
  231. *** perl-4.010/os2/perl.def    Wed Mar 20 08:47:20 1991
  232. --- perl4010/os2/perl.def    Mon Jun 17 08:45:00 1991
  233. ***************
  234. *** 1,2 ****
  235. ! NAME PERL WINDOWCOMPAT NEWFILES
  236. ! DESCRIPTION 'PERL 3.0 - for MS-DOS and OS/2'
  237. --- 1,2 ----
  238. ! NAME WINDOWCOMPAT NEWFILES
  239. ! DESCRIPTION 'PERL 4.0 - for MS-DOS and OS/2'
  240. diff -cbBwr perl-4.010/os2/perlglob.cs perl4010/os2/perlglob.cs
  241. *** perl-4.010/os2/perlglob.cs    Wed Mar 20 08:49:04 1991
  242. --- perl4010/os2/perlglob.cs    Mon Jun 17 08:50:12 1991
  243. ***************
  244. *** 1,9 ****
  245.   os2\glob.c
  246. - (-DPERLGLOB os2\director.c)
  247.   
  248.   setargv.obj
  249. ! os2\perlglob.def
  250. ! os2\perlglob.bad
  251.   perlglob.exe
  252.   
  253.   -AS -LB -S0x1000
  254. --- 1,9 ----
  255.   os2\glob.c
  256.   
  257.   setargv.obj
  258. ! os2\perl.def
  259. ! os2\perl.bad
  260.   perlglob.exe
  261.   
  262.   -AS -LB -S0x1000
  263. diff -cbBwr perl-4.010/os2/popen.c perl4010/os2/popen.c
  264. *** perl-4.010/os2/popen.c    Wed Mar 20 08:47:54 1991
  265. --- perl4010/os2/popen.c    Sun Jun 16 20:17:02 1991
  266. ***************
  267. *** 65,71 ****
  268.           if ( _osmode == DOS_MODE )
  269.             return dos_popen(cmd, mode);
  270.   
  271. !     if (DosMakePipe((PHFILE) &p[0], (PHFILE) &p[1], 4096) < 0)
  272.                   return NULL;
  273.   
  274.           myside = tst(p[WRITEH], p[READH]);
  275. --- 65,71 ----
  276.           if ( _osmode == DOS_MODE )
  277.             return dos_popen(cmd, mode);
  278.   
  279. !         if ( _pipe(p, 4096, 0) )
  280.                   return NULL;
  281.   
  282.           myside = tst(p[WRITEH], p[READH]);
  283. ***************
  284. *** 124,130 ****
  285.   {
  286.     int res;
  287.   
  288. !   if ( res = DosMakePipe((PHFILE) &filedes[0], (PHFILE) &filedes[1], 4096) )
  289.       return res;
  290.   
  291.     DosSetFHandState(filedes[0], OPEN_FLAGS_NOINHERIT);
  292. --- 124,130 ----
  293.   {
  294.     int res;
  295.   
  296. !   if ( res = _pipe(filedes, 4096, 0) )
  297.       return res;
  298.   
  299.     DosSetFHandState(filedes[0], OPEN_FLAGS_NOINHERIT);
  300. ***************
  301. *** 149,154 ****
  302. --- 150,156 ----
  303.   {
  304.       FILE *current;
  305.       char name[128];
  306. +     char *tmp = getenv("TMP");
  307.       int cur;
  308.       pipemode curmode;
  309.   
  310. ***************
  311. *** 165,172 ****
  312.       /*
  313.       ** get a name to use.
  314.       */
  315. !     strcpy(name, "piXXXXXX");
  316. !     Mktemp(name);
  317.   
  318.       /*
  319.       ** If we're reading, just call system to get a file filled with
  320. --- 167,177 ----
  321.       /*
  322.       ** get a name to use.
  323.       */
  324. !     strcpy(name, tmp ? tmp : "\\");
  325. !     if ( name[strlen(name) - 1] != '\\' )
  326. !       strcat(name, "\\");
  327. !     strcat(name, "piXXXXXX");
  328. !     mktemp(name);
  329.   
  330.       /*
  331.       ** If we're reading, just call system to get a file filled with
  332. diff -cbBwr perl-4.010/os2/README.OS2 perl4010/os2/README.OS2
  333. *** perl-4.010/os2/README.OS2    Wed Mar 20 08:46:26 1991
  334. --- perl4010/os2/README.OS2    Mon Jun 17 00:27:52 1991
  335. ***************
  336. *** 404,406 ****
  337. --- 404,436 ----
  338.   
  339.                                   Kai Uwe Rommel
  340.                                   rommel@lan.informatik.tu-muenchen.dbp.de
  341. + Verified perl 4.0 at patchlevel 10
  342. + Changes:
  343. + - some minor corrections and updates in various files
  344. + - new os2/config.h created from original config.H
  345. + - added support for crypt(), PD routine by A.Tanenbaum in new os2/crypt.c
  346. + - added support for wait4pid() in os2.c
  347. + - fixed/added support for -P option (requires a standard CPP for OS/2)
  348. + - os2/mktemp.c deleted, no longer needed
  349. + - new Makefile created for MS C 6.00 and it's NMAKE
  350. + - with os2/perl.cs, bison has no longer to be called manually
  351. + I have successfully run most tests. Diffs are in os2/tests.dif.
  352. + Often, only command names, shell expansion etc. have to be changed.
  353. + Test that still don't run are Unix-specific ones or fail because
  354. + of CR/LF-problems:
  355. + - io/argv.t, io/inplace.t, op/exec.t, op/glob.t  (minor problems)
  356. + - io/fs.t, io/pipe.t op/fork.t, op/magic.t, op/time.t
  357. +    (under OS/2 not supported features of Unix)
  358. + - op/pat.t (bug, not yet fixed)
  359. + Remember to remove the HAS_GDBM symbol from os2/config.h or
  360. + get GNU gdbm for OS/2.
  361. +                 June 1991
  362. +                                 Kai Uwe Rommel
  363. +                                 rommel@lan.informatik.tu-muenchen.dbp.de
  364. diff -cbBwr perl-4.010/perl.c perl4010/perl.c
  365. *** perl-4.010/perl.c    Tue Jun 11 23:37:02 1991
  366. --- perl4010/perl.c    Sun Jun 16 20:28:02 1991
  367. ***************
  368. *** 29,39 ****
  369.   #include "EXTERN.h"
  370.   #include "perl.h"
  371.   #include "perly.h"
  372. - #ifdef MSDOS
  373. - #include "patchlev.h"
  374. - #else
  375.   #include "patchlevel.h"
  376. - #endif
  377.   
  378.   char *getenv();
  379.   
  380. --- 29,35 ----
  381. ***************
  382. *** 321,328 ****
  383.       if (preprocess) {
  384.       str_cat(str,"-I");
  385.       str_cat(str,PRIVLIB);
  386.       (void)sprintf(buf, "\
  387. ! %ssed %s -e '/^[^#]/b' \
  388.    -e '/^#[     ]*include[     ]/b' \
  389.    -e '/^#[     ]*define[     ]/b' \
  390.    -e '/^#[     ]*if[     ]/b' \
  391. --- 317,338 ----
  392.       if (preprocess) {
  393.       str_cat(str,"-I");
  394.       str_cat(str,PRIVLIB);
  395. + #ifdef MSDOS
  396. +     (void)sprintf(buf, "\
  397. + sed %s -e \"/^[^#]/b\" \
  398. +  -e \"/^#[     ]*include[     ]/b\" \
  399. +  -e \"/^#[     ]*define[     ]/b\" \
  400. +  -e \"/^#[     ]*if[     ]/b\" \
  401. +  -e \"/^#[     ]*ifdef[     ]/b\" \
  402. +  -e \"/^#[     ]*ifndef[     ]/b\" \
  403. +  -e \"/^#[     ]*else/b\" \
  404. +  -e \"/^#[     ]*endif/b\" \
  405. +  -e \"s/^#.*//\" \
  406. +  %s | %s -C %s %s",
  407. +       (doextract ? "-e \"1,/^#/d\n\"" : ""),
  408. + #else
  409.       (void)sprintf(buf, "\
  410. ! /bin/sed %s -e '/^[^#]/b' \
  411.    -e '/^#[     ]*include[     ]/b' \
  412.    -e '/^#[     ]*define[     ]/b' \
  413.    -e '/^#[     ]*if[     ]/b' \
  414. ***************
  415. *** 332,343 ****
  416.    -e '/^#[     ]*endif/b' \
  417.    -e 's/^#.*//' \
  418.    %s | %s -C %s %s",
  419. - #ifdef MSDOS
  420. -       "",
  421. - #else
  422. -       "/bin/",
  423. - #endif
  424.         (doextract ? "-e '1,/^#/d\n'" : ""),
  425.         argv[0], CPPSTDIN, str_get(str), CPPMINUS);
  426.   #ifdef DEBUGGING
  427.       if (debug & 64) {
  428. --- 342,349 ----
  429.    -e '/^#[     ]*endif/b' \
  430.    -e 's/^#.*//' \
  431.    %s | %s -C %s %s",
  432.         (doextract ? "-e '1,/^#/d\n'" : ""),
  433. + #endif
  434.         argv[0], CPPSTDIN, str_get(str), CPPMINUS);
  435.   #ifdef DEBUGGING
  436.       if (debug & 64) {
  437. ***************
  438. *** 1197,1203 ****
  439.       fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
  440.       stdout);
  441.   #ifdef OS2
  442. !         fputs("OS/2 port Copyright (c) 1990, Raymond Chen, Kai Uwe Rommel\n",
  443.           stdout);
  444.   #endif
  445.   #endif
  446. --- 1203,1209 ----
  447.       fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
  448.       stdout);
  449.   #ifdef OS2
  450. !         fputs("OS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n",
  451.           stdout);
  452.   #endif
  453.   #endif
  454. diff -cbBwr perl-4.010/util.c perl4010/util.c
  455. *** perl-4.010/util.c    Tue Jun 11 23:36:18 1991
  456. --- perl4010/util.c    Sun Jun 16 19:55:42 1991
  457. ***************
  458. *** 1386,1391 ****
  459. --- 1386,1392 ----
  460.   #endif
  461.   #endif
  462.   }
  463. + #endif /* !MSDOS */
  464.   
  465.   pidgone(pid,status)
  466.   int pid;
  467. ***************
  468. *** 1402,1408 ****
  469.   #endif
  470.       return;
  471.   }
  472. - #endif /* !MSDOS */
  473.   
  474.   #ifndef HAS_MEMCMP
  475.   memcmp(s1,s2,len)
  476. --- 1403,1408 ----
  477. diff -cbBwr perl-4.010/x2p/a2py.c perl4010/x2p/a2py.c
  478. *** perl-4.010/x2p/a2py.c    Tue Jun 11 23:32:12 1991
  479. --- perl4010/x2p/a2py.c    Fri Jun 14 23:49:24 1991
  480. ***************
  481. *** 14,21 ****
  482.    *
  483.    */
  484.   
  485. ! #ifdef MSDOS
  486. ! #include "../patchlev.h"
  487.   #endif
  488.   #include "util.h"
  489.   char *index();
  490. --- 14,21 ----
  491.    *
  492.    */
  493.   
  494. ! #ifdef OS2
  495. ! #include "../patchlevel.h"
  496.   #endif
  497.   #include "util.h"
  498.   char *index();
  499. ***************
  500. *** 26,35 ****
  501.   int checkers = 0;
  502.   STR *walk();
  503.   
  504. ! #ifdef MSDOS
  505.   usage()
  506.   {
  507. !     printf("\nThis is the AWK to PERL translator, version 3.0, patchlevel %d\n", PATCHLEVEL);
  508.       printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname);
  509.       printf("\n  -D<number>      sets debugging flags."
  510.              "\n  -F<character>   the awk script to translate is always invoked with"
  511. --- 26,35 ----
  512.   int checkers = 0;
  513.   STR *walk();
  514.   
  515. ! #ifdef OS2
  516.   usage()
  517.   {
  518. !     printf("\nThis is the AWK to PERL translator, version 4.0, patchlevel %d\n", PATCHLEVEL);
  519.       printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname);
  520.       printf("\n  -D<number>      sets debugging flags."
  521.              "\n  -F<character>   the awk script to translate is always invoked with"
  522. ***************
  523. *** 85,91 ****
  524.           break;
  525.       default:
  526.           fatal("Unrecognized switch: %s\n",argv[0]);
  527. ! #ifdef MSDOS
  528.               usage();
  529.   #endif
  530.       }
  531. --- 85,91 ----
  532.           break;
  533.       default:
  534.           fatal("Unrecognized switch: %s\n",argv[0]);
  535. ! #ifdef OS2
  536.               usage();
  537.   #endif
  538.       }
  539. ***************
  540. *** 95,101 ****
  541.       /* open script */
  542.   
  543.       if (argv[0] == Nullch) {
  544. ! #ifdef MSDOS
  545.       if ( isatty(fileno(stdin)) )
  546.           usage();
  547.   #endif
  548. --- 95,101 ----
  549.       /* open script */
  550.   
  551.       if (argv[0] == Nullch) {
  552. ! #ifdef OS2
  553.       if ( isatty(fileno(stdin)) )
  554.           usage();
  555.   #endif
  556.