home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / AZTEC-C / AZTEC-C.FIX < prev    next >
Internet Message Format  |  2000-06-30  |  2KB

  1. Date: Monday, 26 March 1984  10:28-MST
  2. From: hplabs!tektronix!teklds!azure!keithr at Ucb-Vax.ARPA
  3. To:   info-cpm at Brl-Aos.ARPA
  4. Re:   Aztec CII I/O Redirection (Reposted with new info)
  5.  
  6. (Reposting)
  7.  
  8. The problem of slow redirected I/O  in Aztec C is caused  by
  9. I/O  being  unbuffered. This causes each byte of output that
  10. is redirected to a file to be written seperately (Read  sec-
  11. tor, place byte, write sector). No wonder is so slow.
  12.  
  13. The solution I've been using is simply changing  the  unbuf-
  14. fered  I/O  into  buffered I/O. I've also added a few exten-
  15. tions  which  are  "2>"  (redirect  stderr),  "2>>"  (append
  16. stderr) and ">>" (append stdout).
  17.  
  18. To implement the fix find the file called "CROOT.C"  in  the
  19. source   to  your  library.  It  contains  a  function  call
  20. "Croot()".  Replace the while loop that starts  with  "while
  21. (Argc < MAXARGS)" with the following--
  22.  
  23.  
  24.         while (Argc < MAXARGS) {
  25.                 while (*cp == ' ' || *cp == '')
  26.                    ++cp;
  27.                 if (*cp == NULL)
  28.                    break;
  29.                 k = -1;
  30.                 switch (*cp) {
  31.                    case '>':
  32.                         if (*(cp+1)=='>') {
  33.                            ++cp;
  34.                            k = 1;
  35.                         } else
  36.                            k = 1;
  37.                         break;
  38.                    case '<':
  39.                         k = 0;
  40.                         break;
  41.                    case '2':
  42.                         if (*(cp+1)) == '>') {
  43.                            ++cp;
  44.                            if (*(cp+1) == '>') {
  45.                               ++cp;
  46.                               k = 5;
  47.                            } else
  48.                               k = 2;
  49.                         }
  50.