--- a/DirStr.st Sat Jan 08 17:12:03 1994 +0100
+++ b/DirStr.st Sat Jan 08 17:18:40 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Attic/DirStr.st,v 1.5 1993-11-08 02:30:07 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/DirStr.st,v 1.6 1994-01-08 16:17:01 claus Exp $
'!
%{
@@ -85,13 +85,13 @@
if (_INST(dirPointer) != nil) {
d = (DIR *)MKFD(_INST(dirPointer));
- do {
+ do {
dp = readdir(d);
- } while ((dp == NULL) && (errno == EINTR));
+ } while ((dp == NULL) && (errno == EINTR));
if (dp != NULL) {
nextEntry = _MKSTRING((char *)(dp->d_name) COMMA_CON);
}
- ErrorNumber = _MKSMALLINT(errno);
+ ErrorNumber = _MKSMALLINT(errno);
}
#endif
%}
@@ -120,9 +120,9 @@
if (_INST(dirPointer) == nil) {
path = _INST(pathName);
if (_isString(path)) {
- do {
+ do {
d = opendir((char *) _stringVal(path));
- } while ((d == NULL) && (errno == EINTR));
+ } while ((d == NULL) && (errno == EINTR));
if (d == NULL) {
/* ErrorString = _MKSTRING(perror("popen:") COMMA_CON); */
ErrorNumber = _MKSMALLINT(errno);
@@ -140,7 +140,7 @@
^ PipeStream readingFrom:('cd ' , pathName , '; ls -a')
].
(retVal == true) ifTrue:[
- lobby register:self.
+ Lobby register:self.
self nextLine. "read 1st entry into readAhead buffer"
^ self
].
@@ -166,7 +166,7 @@
"close the stream - tell operating system"
dirPointer notNil ifTrue:[
- lobby unregister:self.
+ Lobby unregister:self.
self closeFile.
dirPointer := nil
]
--- a/DirectoryStream.st Sat Jan 08 17:12:03 1994 +0100
+++ b/DirectoryStream.st Sat Jan 08 17:18:40 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.5 1993-11-08 02:30:07 claus Exp $
+$Header: /cvs/stx/stx/libbasic/DirectoryStream.st,v 1.6 1994-01-08 16:17:01 claus Exp $
'!
%{
@@ -85,13 +85,13 @@
if (_INST(dirPointer) != nil) {
d = (DIR *)MKFD(_INST(dirPointer));
- do {
+ do {
dp = readdir(d);
- } while ((dp == NULL) && (errno == EINTR));
+ } while ((dp == NULL) && (errno == EINTR));
if (dp != NULL) {
nextEntry = _MKSTRING((char *)(dp->d_name) COMMA_CON);
}
- ErrorNumber = _MKSMALLINT(errno);
+ ErrorNumber = _MKSMALLINT(errno);
}
#endif
%}
@@ -120,9 +120,9 @@
if (_INST(dirPointer) == nil) {
path = _INST(pathName);
if (_isString(path)) {
- do {
+ do {
d = opendir((char *) _stringVal(path));
- } while ((d == NULL) && (errno == EINTR));
+ } while ((d == NULL) && (errno == EINTR));
if (d == NULL) {
/* ErrorString = _MKSTRING(perror("popen:") COMMA_CON); */
ErrorNumber = _MKSMALLINT(errno);
@@ -140,7 +140,7 @@
^ PipeStream readingFrom:('cd ' , pathName , '; ls -a')
].
(retVal == true) ifTrue:[
- lobby register:self.
+ Lobby register:self.
self nextLine. "read 1st entry into readAhead buffer"
^ self
].
@@ -166,7 +166,7 @@
"close the stream - tell operating system"
dirPointer notNil ifTrue:[
- lobby unregister:self.
+ Lobby unregister:self.
self closeFile.
dirPointer := nil
]
--- a/ExtStream.st Sat Jan 08 17:12:03 1994 +0100
+++ b/ExtStream.st Sat Jan 08 17:18:40 1994 +0100
@@ -12,7 +12,7 @@
ReadWriteStream subclass:#ExternalStream
instanceVariableNames:'filePointer mode buffered binary useCRLF hitEOF'
- classVariableNames:'lobby'
+ classVariableNames:'Lobby'
poolDictionaries:''
category:'Streams-External'
!
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.9 1993-12-19 23:39:56 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ExtStream.st,v 1.10 1994-01-08 16:17:40 claus Exp $
written 88 by claus
'!
@@ -67,8 +67,8 @@
!ExternalStream class methodsFor:'initialization'!
initialize
- lobby isNil ifTrue:[
- lobby := Registry new.
+ Lobby isNil ifTrue:[
+ Lobby := Registry new.
"want to get informed when returning from snapshot"
ObjectMemory addDependent:self
@@ -78,7 +78,7 @@
reOpenFiles
"reopen all files (if possible) after a snapShot load"
- lobby contentsDo:[:aFileStream |
+ Lobby contentsDo:[:aFileStream |
aFileStream reOpen
]
!
@@ -138,7 +138,7 @@
self class name print. ': cannot reOpen stream - stream closed' printNewline.
filePointer := nil.
- lobby unregister:self.
+ Lobby unregister:self.
! !
!ExternalStream methodsFor:'error handling'!
@@ -330,7 +330,7 @@
"close the stream - tell operating system"
filePointer isNil ifTrue:[^ self].
- lobby unregister:self.
+ Lobby unregister:self.
self closeFile.
filePointer := nil
!
@@ -1700,10 +1700,10 @@
_immediateInterrupt = 1;
buffer[0] = 0;
- /*
- * mhmh - the following code looks ok to me,
+ /*
+ * mhmh - the following code looks ok to me,
* but seems not to work for sockets
- */
+ */
#ifdef DOES_NOT_WORK
if (_INST(mode) == _readwrite)
fseek(f, 0L, 1); /* needed in stdio */
@@ -1714,23 +1714,23 @@
if (_INST(buffered) == true) {
if (_INST(mode) == _readwrite)
fseek(f, 0L, 1); /* needed in stdio */
- }
+ }
rslt = buffer;
fd = fileno(f);
for (;;) {
- if (_INST(buffered) == true) {
+ if (_INST(buffered) == true) {
ch = getc(f);
- if (ch == EOF)
- len = 0;
- else {
- len = 1;
- *rslt = ch;
- }
- } else {
+ if (ch == EOF)
+ len = 0;
+ else {
+ len = 1;
+ *rslt = ch;
+ }
+ } else {
do {
len = read(fd, rslt, 1);
} while ((len < 0) && (errno == EINTR));
- }
+ }
if (len <= 0) {
if (rslt == buffer) {
rslt = NULL;
--- a/ExternalStream.st Sat Jan 08 17:12:03 1994 +0100
+++ b/ExternalStream.st Sat Jan 08 17:18:40 1994 +0100
@@ -12,7 +12,7 @@
ReadWriteStream subclass:#ExternalStream
instanceVariableNames:'filePointer mode buffered binary useCRLF hitEOF'
- classVariableNames:'lobby'
+ classVariableNames:'Lobby'
poolDictionaries:''
category:'Streams-External'
!
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.9 1993-12-19 23:39:56 claus Exp $
+$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.10 1994-01-08 16:17:40 claus Exp $
written 88 by claus
'!
@@ -67,8 +67,8 @@
!ExternalStream class methodsFor:'initialization'!
initialize
- lobby isNil ifTrue:[
- lobby := Registry new.
+ Lobby isNil ifTrue:[
+ Lobby := Registry new.
"want to get informed when returning from snapshot"
ObjectMemory addDependent:self
@@ -78,7 +78,7 @@
reOpenFiles
"reopen all files (if possible) after a snapShot load"
- lobby contentsDo:[:aFileStream |
+ Lobby contentsDo:[:aFileStream |
aFileStream reOpen
]
!
@@ -138,7 +138,7 @@
self class name print. ': cannot reOpen stream - stream closed' printNewline.
filePointer := nil.
- lobby unregister:self.
+ Lobby unregister:self.
! !
!ExternalStream methodsFor:'error handling'!
@@ -330,7 +330,7 @@
"close the stream - tell operating system"
filePointer isNil ifTrue:[^ self].
- lobby unregister:self.
+ Lobby unregister:self.
self closeFile.
filePointer := nil
!
@@ -1700,10 +1700,10 @@
_immediateInterrupt = 1;
buffer[0] = 0;
- /*
- * mhmh - the following code looks ok to me,
+ /*
+ * mhmh - the following code looks ok to me,
* but seems not to work for sockets
- */
+ */
#ifdef DOES_NOT_WORK
if (_INST(mode) == _readwrite)
fseek(f, 0L, 1); /* needed in stdio */
@@ -1714,23 +1714,23 @@
if (_INST(buffered) == true) {
if (_INST(mode) == _readwrite)
fseek(f, 0L, 1); /* needed in stdio */
- }
+ }
rslt = buffer;
fd = fileno(f);
for (;;) {
- if (_INST(buffered) == true) {
+ if (_INST(buffered) == true) {
ch = getc(f);
- if (ch == EOF)
- len = 0;
- else {
- len = 1;
- *rslt = ch;
- }
- } else {
+ if (ch == EOF)
+ len = 0;
+ else {
+ len = 1;
+ *rslt = ch;
+ }
+ } else {
do {
len = read(fd, rslt, 1);
} while ((len < 0) && (errno == EINTR));
- }
+ }
if (len <= 0) {
if (rslt == buffer) {
rslt = NULL;
--- a/FileDir.st Sat Jan 08 17:12:03 1994 +0100
+++ b/FileDir.st Sat Jan 08 17:18:40 1994 +0100
@@ -12,7 +12,7 @@
Collection subclass:#FileDirectory
instanceVariableNames:'pathName lazy'
- classVariableNames:'pathOfCurrentDirectory'
+ classVariableNames:'PathOfCurrentDirectory'
poolDictionaries:''
category:'Collections-Files'
!
@@ -26,7 +26,7 @@
They provide various methods to create/delete and query for files and/or
directories.
-$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.7 1993-12-12 21:53:55 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.8 1994-01-08 16:18:31 claus Exp $
written winter 89 by claus
'!
@@ -40,7 +40,7 @@
update:something
something == #restarted ifTrue:[
- pathOfCurrentDirectory := nil
+ PathOfCurrentDirectory := nil
]
! !
@@ -193,8 +193,8 @@
"since currentDirectory is used very often, cache its path here"
(pathName = '.') ifTrue:[
- pathOfCurrentDirectory notNil ifTrue:[
- pathName := pathOfCurrentDirectory.
+ PathOfCurrentDirectory notNil ifTrue:[
+ pathName := PathOfCurrentDirectory.
lazy := false.
^ self
]
@@ -244,7 +244,7 @@
"if it was the current dir, keep name for next query"
(shortPathName = '.') ifTrue:[
- pathOfCurrentDirectory := fullPathName
+ PathOfCurrentDirectory := fullPathName
]
! !
--- a/FileDirectory.st Sat Jan 08 17:12:03 1994 +0100
+++ b/FileDirectory.st Sat Jan 08 17:18:40 1994 +0100
@@ -12,7 +12,7 @@
Collection subclass:#FileDirectory
instanceVariableNames:'pathName lazy'
- classVariableNames:'pathOfCurrentDirectory'
+ classVariableNames:'PathOfCurrentDirectory'
poolDictionaries:''
category:'Collections-Files'
!
@@ -26,7 +26,7 @@
They provide various methods to create/delete and query for files and/or
directories.
-$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.7 1993-12-12 21:53:55 claus Exp $
+$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.8 1994-01-08 16:18:31 claus Exp $
written winter 89 by claus
'!
@@ -40,7 +40,7 @@
update:something
something == #restarted ifTrue:[
- pathOfCurrentDirectory := nil
+ PathOfCurrentDirectory := nil
]
! !
@@ -193,8 +193,8 @@
"since currentDirectory is used very often, cache its path here"
(pathName = '.') ifTrue:[
- pathOfCurrentDirectory notNil ifTrue:[
- pathName := pathOfCurrentDirectory.
+ PathOfCurrentDirectory notNil ifTrue:[
+ pathName := PathOfCurrentDirectory.
lazy := false.
^ self
]
@@ -244,7 +244,7 @@
"if it was the current dir, keep name for next query"
(shortPathName = '.') ifTrue:[
- pathOfCurrentDirectory := fullPathName
+ PathOfCurrentDirectory := fullPathName
]
! !
--- a/FileStr.st Sat Jan 08 17:12:03 1994 +0100
+++ b/FileStr.st Sat Jan 08 17:18:40 1994 +0100
@@ -24,7 +24,7 @@
This class provides access to the operating systems underlying file
system (i.e. its an interface to the stdio library).
-$Header: /cvs/stx/stx/libbasic/Attic/FileStr.st,v 1.6 1993-12-11 00:48:19 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/FileStr.st,v 1.7 1994-01-08 16:18:37 claus Exp $
'!
%{
@@ -181,7 +181,7 @@
store:something
"what really should this do"
- self nextPutAll:something printString
+ self nextPutAll:something storeString
!
directoryName
@@ -198,7 +198,7 @@
].
(lastIndex == 0) ifTrue:[^ '.'].
(lastIndex == 1) ifTrue:[^ '/'].
- ^ path copyFrom:1 to:(lastIndex - 1)
+ ^ path copyTo:(lastIndex - 1)
!
name
@@ -298,7 +298,7 @@
.
retVal notNil ifTrue:[
buffered := true. "default is buffered"
- lobby register:self
+ Lobby register:self
].
^ retVal
!
@@ -351,7 +351,7 @@
filePointer notNil ifTrue:[
"it was open, when snapped-out"
filePointer := nil.
- lobby unregister:self.
+ Lobby unregister:self.
self open.
filePointer isNil ifTrue:[
"this happens, if after a restart, the file is no longer accessable ..."
@@ -361,7 +361,9 @@
self position:position.
]
]
-!
+! !
+
+!FileStream methodsFor:'queries'!
size
"return the size in bytes of the file"
@@ -412,7 +414,7 @@
position
"return the read/write position in the file -
- notice, in smalltalk indices start at 1 so begin of file is 1""
+ notice, in smalltalk indices start at 1 so begin of file is 1"
%{ /* NOCONTEXT */
--- a/FileStream.st Sat Jan 08 17:12:03 1994 +0100
+++ b/FileStream.st Sat Jan 08 17:18:40 1994 +0100
@@ -24,7 +24,7 @@
This class provides access to the operating systems underlying file
system (i.e. its an interface to the stdio library).
-$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.6 1993-12-11 00:48:19 claus Exp $
+$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.7 1994-01-08 16:18:37 claus Exp $
'!
%{
@@ -181,7 +181,7 @@
store:something
"what really should this do"
- self nextPutAll:something printString
+ self nextPutAll:something storeString
!
directoryName
@@ -198,7 +198,7 @@
].
(lastIndex == 0) ifTrue:[^ '.'].
(lastIndex == 1) ifTrue:[^ '/'].
- ^ path copyFrom:1 to:(lastIndex - 1)
+ ^ path copyTo:(lastIndex - 1)
!
name
@@ -298,7 +298,7 @@
.
retVal notNil ifTrue:[
buffered := true. "default is buffered"
- lobby register:self
+ Lobby register:self
].
^ retVal
!
@@ -351,7 +351,7 @@
filePointer notNil ifTrue:[
"it was open, when snapped-out"
filePointer := nil.
- lobby unregister:self.
+ Lobby unregister:self.
self open.
filePointer isNil ifTrue:[
"this happens, if after a restart, the file is no longer accessable ..."
@@ -361,7 +361,9 @@
self position:position.
]
]
-!
+! !
+
+!FileStream methodsFor:'queries'!
size
"return the size in bytes of the file"
@@ -412,7 +414,7 @@
position
"return the read/write position in the file -
- notice, in smalltalk indices start at 1 so begin of file is 1""
+ notice, in smalltalk indices start at 1 so begin of file is 1"
%{ /* NOCONTEXT */
--- a/Float.st Sat Jan 08 17:12:03 1994 +0100
+++ b/Float.st Sat Jan 08 17:18:40 1994 +0100
@@ -22,7 +22,7 @@
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Float.st,v 1.6 1993-12-12 20:52:40 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Float.st,v 1.7 1994-01-08 16:18:40 claus Exp $
notice, that Floats are defined as Byte-array to prevent garbage collector
from going into the value ... otherwise I needed a special case in many places.
@@ -781,6 +781,7 @@
f := self basicNew.
bytes := stream next:8.
+
"kludge: assumes IEEE format"
UninterpretedBytes isBigEndian ifTrue:[
"swap the bytes"
@@ -817,9 +818,12 @@
char buffer[64];
REGISTER char *cp;
-#ifdef THISCONTEXT_IN_REGISTER
+ /*
+ * actually only needed on sparc: since thisContext is
+ * in a global register, which gets destroyed by printf,
+ * manually save it here - very stupid ...
+ */
OBJ sav = __thisContext;
-#endif
#ifdef SYSV
sprintf(buffer, "%.6lg", _floatVal(self));
@@ -827,9 +831,7 @@
sprintf(buffer, "%.6G", _floatVal(self));
#endif
-#ifdef THISCONTEXT_IN_REGISTER
__thisContext = sav;
-#endif
/*
* kludge to make integral float f prints as "f.0" (not as "f" as printf does)
* (i.e. look if string contains '.' or 'e' and append '.0' if not)
@@ -855,23 +857,25 @@
printfPrintString:formatString
"non-portable: return a printed representation of the receiver
as specified by formatString, which is defined by printf.
- If you use this, be aware, that specifying doubles differes on
+ If you use this, be aware, that specifying doubles differs on
systems; on SYSV machines you have to give something like %lf,
while on BSD systems the format string has to be %F.
- Also, the resulting string must not be longer than 255 bytes -
+ Also, the resulting string may not be longer than 255 bytes -
since thats the (static) size of the buffer."
%{ /* STACK: 400 */
char buffer[256];
if (_isString(formatString)) {
-#ifdef THISCONTEXT_IN_REGISTER
+ /*
+ * actually only needed on sparc: since thisContext is
+ * in a global register, which gets destroyed by printf,
+ * manually save it here - very stupid ...
+ */
OBJ sav = __thisContext;
-#endif
+
sprintf(buffer, _stringVal(formatString), _floatVal(self));
-#ifdef THISCONTEXT_IN_REGISTER
__thisContext = sav;
-#endif
RETURN ( _MKSTRING(buffer COMMA_SND) );
}
%}