ExternalStream.st
changeset 971 eb70f5674303
parent 933 2eebae059045
child 1044 c2fb3818e097
equal deleted inserted replaced
970:3b59c9b38dbb 971:eb70f5674303
   664 nextLine
   664 nextLine
   665     "read the next line (characters up to newline).
   665     "read the next line (characters up to newline).
   666      Return a string containing those characters excluding the newline.
   666      Return a string containing those characters excluding the newline.
   667      If the previous-to-last character is a cr, this is also removed,
   667      If the previous-to-last character is a cr, this is also removed,
   668      so its possible to read alien (i.e. ms-dos) text as well.
   668      so its possible to read alien (i.e. ms-dos) text as well.
   669      The line must be shorter than 1K characters - otherwise its truncated."
   669      The line must be shorter than 16K characters - otherwise its truncated."
   670 
   670 
   671 %{  /* STACK:2000 */
   671 %{  /* STACK:17000 */
   672 
   672 
   673     FILE *f;
   673     FILE *f;
   674     int len;
   674     int len;
   675     char buffer[1024];
   675     char buffer[16*1024];
   676     char *rslt, *nextPtr, *limit;
   676     char *rslt, *nextPtr, *limit;
   677     int fd, ch;
   677     int fd, ch;
   678     int _buffered;
   678     int _buffered;
   679     OBJ fp;
   679     OBJ fp;
   680     OBJ __MKSTRING_L();
   680     OBJ __MKSTRING_L();
   754 		    break;
   754 		    break;
   755 		}
   755 		}
   756 		nextPtr++;
   756 		nextPtr++;
   757 		if (nextPtr >= limit) {
   757 		if (nextPtr >= limit) {
   758 		    *nextPtr = '\0';
   758 		    *nextPtr = '\0';
       
   759 		    fprintf(stderr, "EXTSTREAM: line truncated in nextLine\n");
   759 		    break;
   760 		    break;
   760 		}
   761 		}
   761 	    }
   762 	    }
   762 #endif
   763 #endif
   763 	    __END_INTERRUPTABLE__
   764 	    __END_INTERRUPTABLE__
  3542 ! !
  3543 ! !
  3543 
  3544 
  3544 !ExternalStream class methodsFor:'documentation'!
  3545 !ExternalStream class methodsFor:'documentation'!
  3545 
  3546 
  3546 version
  3547 version
  3547     ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.86 1996-02-04 19:19:58 cg Exp $'
  3548     ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.87 1996-02-20 16:32:47 cg Exp $'
  3548 ! !
  3549 ! !
  3549 ExternalStream initialize!
  3550 ExternalStream initialize!