Merged 5558dc303721 and 210c3f685d38 (branch default - CVS HEAD) jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 20 Aug 2013 00:07:19 +0100
branchjv
changeset 18084 ab5b38bd8f81
parent 18083 5558dc303721 (current diff)
parent 15642 210c3f685d38 (diff)
child 18085 d27c9dd72330
Merged 5558dc303721 and 210c3f685d38 (branch default - CVS HEAD)
Array.st
ByteArray.st
CharacterArray.st
CharacterEncoder.st
Class.st
ClassCategoryReader.st
Collection.st
Delay.st
EncodedStream.st
ExternalStream.st
FileDirectory.st
FileStream.st
FixedPoint.st
GenericException.st
HashStream.st
LargeInteger.st
MD5Stream.st
Method.st
ObjectMemory.st
PositionableStream.st
ProcessorScheduler.st
ReadStream.st
SHA1Stream.st
Semaphore.st
SharedPool.st
Smalltalk.st
Stream.st
Win32OperatingSystem.st
WriteStream.st
--- a/.hgtags	Mon Aug 19 23:30:27 2013 +0100
+++ b/.hgtags	Tue Aug 20 00:07:19 2013 +0100
@@ -9,8 +9,6 @@
 288a01786ed5f59915047167fba6c00b36226c4a expeccoNET_1_5_1rc1
 28ef0472cf2f08acd9c2056a517e1fae4bc8033d expecco_2_2_5
 2f39b0b6f4e6ecc84a698e16accec417b27b0da4 expecco_1_3_4
-35cb06ede3a7719ca03b3c6097f78a7cf247527f expecco_2_5_1
-35cb06ede3a7719ca03b3c6097f78a7cf247527f stable
 373af30a15cafccd184b57b8492979e1969af65f rel3_4_1_1
 3816e831f5f3ed00876f38adbfaf1a25ad010ed7 rel2_10_8_6_last_before_vmData_change
 471ed2bb3bf16111afbf2e0d6dfb422d78294aca expecco_1_0_3
@@ -50,6 +48,8 @@
 cbc08817ae5dd258c1d2d4456c389f6f34bfe853 expecco_1_7_1rc3
 cbc08817ae5dd258c1d2d4456c389f6f34bfe853 expecco_1_7_1rc4
 cfc48336f2493581c8f183deeb3715bbd32bb403 expecco_2_0_0_0
+d08f9fa63cc261b8d42f615bd7109020b9a1ba9c expecco_2_5_1
+d08f9fa63cc261b8d42f615bd7109020b9a1ba9c stable
 d09af69f046633ce668c90d046c6cd3465bd9193 rel5_1_4
 da05376dea2daaa5ba82ab647436ec3fc52df2d8 stx_6_2_2
 e0cc829d4b4ded0bb078233ea50f75f48b3e15f5 expeccoNET_1_5_0rc1
--- a/Array.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Array.st	Tue Aug 20 00:07:19 2013 +0100
@@ -280,7 +280,6 @@
     "Modified: 23.4.1996 / 15:55:06 / cg"
 ! !
 
-
 !Array methodsFor:'accessing'!
 
 at:index
@@ -1689,50 +1688,50 @@
     "append a printed representation of the receiver to aStream"
 
     self isLiteral ifTrue:[
-	|limit firstOne s|
+        |limit firstOne s|
 
-	thisContext isRecursive ifTrue:[
-	    'Array [error]: printOn: of self referencing collection.' errorPrintCR.
-	    aStream nextPutAll:'#("recursive")'.
-	    ^ self
-	].
+        thisContext isRecursive ifTrue:[
+            'Array [error]: printOn: of self referencing collection.' errorPrintCR.
+            aStream nextPutAll:'#("recursive")'.
+            ^ self
+        ].
 
-	aStream nextPutAll:'#('.
-	firstOne := true.
+        aStream nextPutAll:'#('.
+        firstOne := true.
 
-	"
-	 if aStream is not positionable, create an temporary positionable stream
-	 (needed for limit calculation)
-	"
-	aStream isPositionable ifTrue:[
-	    s := aStream.
-	] ifFalse:[
-	    s := WriteStream on:(String uninitializedNew:50).
-	].
-	limit := s position1Based + self maxPrint.
+        "
+         if aStream is not positionable, create an temporary positionable stream
+         (needed for limit calculation)
+        "
+        aStream isPositionable ifTrue:[
+            s := aStream.
+        ] ifFalse:[
+            s := WriteStream on:(String uninitializedNew:50).
+        ].
+        limit := s position + self maxPrint.
 
-	self printElementsDo:[:element |
-	    firstOne ifFalse:[
-		s space
-	    ] ifTrue:[
-		firstOne := false
-	    ].
-	    (s position1Based >= limit) ifTrue:[
-		s ~~ aStream ifTrue:[
-		    aStream nextPutAll:(s contents).
-		].
-		aStream nextPutAll:'...etc...)'.
-		^ self
-	    ] ifFalse:[
-		element printOn:s.
-	    ].
-	].
-	s ~~ aStream ifTrue:[
-	    aStream nextPutAll:(s contents).
-	].
-	aStream nextPut:$)
+        self printElementsDo:[:element |
+            firstOne ifFalse:[
+                s space
+            ] ifTrue:[
+                firstOne := false
+            ].
+            (s position >= limit) ifTrue:[
+                s ~~ aStream ifTrue:[
+                    aStream nextPutAll:(s contents).
+                ].
+                aStream nextPutAll:'...etc...)'.
+                ^ self
+            ] ifFalse:[
+                element printOn:s.
+            ].
+        ].
+        s ~~ aStream ifTrue:[
+            aStream nextPutAll:(s contents).
+        ].
+        aStream nextPut:$)
     ] ifFalse:[
-	super printOn:aStream
+        super printOn:aStream
     ]
 
     "
@@ -2580,10 +2579,10 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.158 2013-04-04 07:55:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.160 2013-08-10 11:11:14 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.158 2013-04-04 07:55:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.160 2013-08-10 11:11:14 stefan Exp $'
 ! !
 
--- a/ByteArray.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ByteArray.st	Tue Aug 20 00:07:19 2013 +0100
@@ -190,13 +190,23 @@
     "return a new byteArray containing the bitWise-xor of the receiver's and the
      argument's bytes"
 
-    |answer|
-
-    answer := self copy.
-    1 to: self size do: [ :each |
-	answer at: each put: ((self at: each) bitXor: (aByteArray at: each))
+    |size size1|
+
+    "size := self size min:aByteArray size"
+    size := self size.
+    size1 := aByteArray size.
+    size1 < size ifTrue:[
+        size := size1.
     ].
-    ^ answer
+
+    ^ self copy
+        bitXorBytesFrom:1 to:size with:aByteArray startingAt:1;
+        yourself.
+
+    "
+        #[0 1 2 3 4] bitXor:#[0 1 2 3 4]
+        #[0 1 2 3 4] bitXor:#[0 1 2 3]
+    "
 ! !
 
 !ByteArray methodsFor:'Compatibility-VW'!
@@ -3017,10 +3027,10 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.211 2013-08-12 10:09:48 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.211 2013-08-12 10:09:48 stefan Exp $'
 ! !
 
--- a/CharacterArray.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/CharacterArray.st	Tue Aug 20 00:07:19 2013 +0100
@@ -1642,8 +1642,8 @@
 
 indexOfControlCharacterStartingAt:startIndex
     "return the index of the next control character;
-     starting the search at startIndex, searching forward;
      that is a character with asciiValue < 32.
+     Start the search at startIndex, searching forward.
      Return 0 if none is found."
 
     |start  "{ Class: SmallInteger }"
@@ -1653,7 +1653,7 @@
     mySize := self size.
 
     start to:mySize do:[:index |
-	(self at:index) isControlCharacter ifTrue:[^ index]
+        (self at:index) isControlCharacter ifTrue:[^ index]
     ].
     ^ 0
 
@@ -5570,7 +5570,7 @@
 !
 
 withoutCEscapes
-    "return a new string consisting of receivers characters
+    "return a new string consisting of receiver's characters
      with all \X-character escapes replaced by corresponding-characters.
      (similar to the way C-language Strings are converted).
      The following escapes are supported:
@@ -6412,11 +6412,11 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.508 2013-07-23 17:21:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.510 2013-08-13 17:31:00 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.508 2013-07-23 17:21:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.510 2013-08-13 17:31:00 cg Exp $'
 !
 
 version_HG
--- a/CharacterEncoder.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/CharacterEncoder.st	Tue Aug 20 00:07:19 2013 +0100
@@ -213,7 +213,6 @@
 "
 ! !
 
-
 !CharacterEncoder class methodsFor:'instance creation'!
 
 encoderFor:encodingNameSymbol
@@ -519,7 +518,6 @@
     "Modified: / 12-07-2012 / 19:45:15 / cg"
 ! !
 
-
 !CharacterEncoder class methodsFor:'Compatibility-ST80'!
 
 encoderNamed: encoderName
@@ -539,14 +537,12 @@
     "Modified: 20.6.1997 / 17:38:40 / cg"
 ! !
 
-
 !CharacterEncoder class methodsFor:'accessing'!
 
 nullEncoderInstance
     ^ NullEncoderInstance
 ! !
 
-
 !CharacterEncoder class methodsFor:'class initialization'!
 
 initialize
@@ -723,7 +719,6 @@
     "Modified (format): / 23-01-2013 / 09:56:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !CharacterEncoder class methodsFor:'constants'!
 
 jis7KanjiEscapeSequence
@@ -769,7 +764,6 @@
     ^ JisISO2022EscapeSequence.
 ! !
 
-
 !CharacterEncoder class methodsFor:'encoding & decoding'!
 
 decode:aCodePoint
@@ -881,7 +875,6 @@
     "
 ! !
 
-
 !CharacterEncoder class methodsFor:'private'!
 
 flushCode
@@ -899,7 +892,6 @@
     "
 ! !
 
-
 !CharacterEncoder class methodsFor:'private-mapping setup'!
 
 generateCode
@@ -950,7 +942,6 @@
     ^ 'http://std.dkuug.dk/i18n/charmaps/' , rel
 ! !
 
-
 !CharacterEncoder class methodsFor:'queries'!
 
 isEncoding:subSetEncodingArg subSetOf:superSetEncodingArg
@@ -1054,7 +1045,6 @@
     ^ self nameOfEncoding asUppercaseFirst
 ! !
 
-
 !CharacterEncoder class methodsFor:'testing'!
 
 isAbstract
@@ -1065,7 +1055,6 @@
     ^ self == CharacterEncoder
 ! !
 
-
 !CharacterEncoder class methodsFor:'utilities'!
 
 guessEncodingOfBuffer:buffer
@@ -1122,7 +1111,7 @@
 
         (idx := lcBuffer findString:keyWord) ~~ 0 ifTrue:[
             s := ReadStream on:buffer.
-            s position1Based:idx.
+            s position:idx-1.
             s skip:keyWord size.
             s skipSeparators. 
 
@@ -1251,7 +1240,6 @@
     "
 ! !
 
-
 !CharacterEncoder methodsFor:'encoding & decoding'!
 
 decode:anEncoding
@@ -1328,7 +1316,6 @@
     ^ newString
 ! !
 
-
 !CharacterEncoder methodsFor:'error handling'!
 
 decodingError 
@@ -1385,7 +1372,6 @@
     "Modified: / 12-07-2012 / 20:36:37 / cg"
 ! !
 
-
 !CharacterEncoder methodsFor:'printing'!
 
 printOn:aStream
@@ -1395,14 +1381,12 @@
         nextPutAll:(self nameOfEncoding)
 ! !
 
-
 !CharacterEncoder methodsFor:'private'!
 
 newString:size
     self subclassResponsibility
 ! !
 
-
 !CharacterEncoder methodsFor:'queries'!
 
 characterSize:codePoint
@@ -1432,7 +1416,6 @@
     ^ self class userFriendlyNameOfEncoding
 ! !
 
-
 !CharacterEncoder methodsFor:'stream support'!
 
 readNext:charactersToRead charactersFrom:stream 
@@ -1458,7 +1441,6 @@
     ^ aStream next
 ! !
 
-
 !CharacterEncoder::CompoundEncoder class methodsFor:'documentation'!
 
 documentation
@@ -1478,7 +1460,6 @@
 "
 ! !
 
-
 !CharacterEncoder::CompoundEncoder methodsFor:'accessing'!
 
 encoder:encoderArg decoder:decoderArg  
@@ -1488,7 +1469,6 @@
     encoder := encoderArg.
 ! !
 
-
 !CharacterEncoder::CompoundEncoder methodsFor:'encoding & decoding'!
 
 decode:aCode
@@ -1507,7 +1487,6 @@
     ^ encoder encodeString:(decoder decodeString:aString)
 ! !
 
-
 !CharacterEncoder::CompoundEncoder methodsFor:'printing'!
 
 printOn:aStream
@@ -1520,7 +1499,6 @@
     encoder printOn:aStream
 ! !
 
-
 !CharacterEncoder::DefaultEncoder class methodsFor:'documentation'!
 
 documentation
@@ -1529,7 +1507,6 @@
 "
 ! !
 
-
 !CharacterEncoder::InverseEncoder class methodsFor:'documentation'!
 
 documentation
@@ -1539,14 +1516,12 @@
 "
 ! !
 
-
 !CharacterEncoder::InverseEncoder methodsFor:'accessing'!
 
 decoder:something
     decoder := something.
 ! !
 
-
 !CharacterEncoder::InverseEncoder methodsFor:'encoding & decoding'!
 
 decode:aCode
@@ -1565,7 +1540,6 @@
     ^ decoder decodeString:aString
 ! !
 
-
 !CharacterEncoder::InverseEncoder methodsFor:'printing'!
 
 printOn:aStream
@@ -1575,21 +1549,18 @@
         nextPutAll:(decoder nameOfDecodedCode)
 ! !
 
-
 !CharacterEncoder::InverseEncoder methodsFor:'queries'!
 
 characterSize:charOrcodePoint
     ^ decoder characterSize:charOrcodePoint
 ! !
 
-
 !CharacterEncoder::InverseEncoder methodsFor:'stream support'!
 
 readNextInputCharacterFrom:aStream
     ^ decoder readNextInputCharacterFrom:aStream
 ! !
 
-
 !CharacterEncoder::NullEncoder class methodsFor:'documentation'!
 
 documentation
@@ -1598,7 +1569,6 @@
 "
 ! !
 
-
 !CharacterEncoder::NullEncoder methodsFor:'encoding & decoding'!
 
 decode:aCode
@@ -1617,14 +1587,12 @@
     ^ aString
 ! !
 
-
 !CharacterEncoder::NullEncoder methodsFor:'queries'!
 
 isNullEncoder
     ^ true
 ! !
 
-
 !CharacterEncoder::OtherEncoding class methodsFor:'private'!
 
 flushCode
@@ -1633,7 +1601,6 @@
 generateEncoderCode
 ! !
 
-
 !CharacterEncoder::TwoStepEncoder class methodsFor:'documentation'!
 
 documentation
@@ -1646,7 +1613,6 @@
 "
 ! !
 
-
 !CharacterEncoder::TwoStepEncoder methodsFor:'accessing'!
 
 encoder1:encoder1Arg encoder2:encoder2Arg
@@ -1656,7 +1622,6 @@
     encoder2 := encoder2Arg.
 ! !
 
-
 !CharacterEncoder::TwoStepEncoder methodsFor:'encoding & decoding'!
 
 decode:aCode
@@ -1675,7 +1640,6 @@
     ^ encoder2 encodeString:(encoder1 encodeString:aString)
 ! !
 
-
 !CharacterEncoder::TwoStepEncoder methodsFor:'printing'!
 
 printOn:aStream
@@ -1687,7 +1651,6 @@
         nextPutAll:(encoder2 nameOfEncoding)
 ! !
 
-
 !CharacterEncoder::TwoStepEncoder methodsFor:'queries'!
 
 characterSize:codePoint
@@ -1717,15 +1680,14 @@
 
 ! !
 
-
 !CharacterEncoder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.122 2013-03-20 10:37:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.123 2013-08-10 11:13:37 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.122 2013-03-20 10:37:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.123 2013-08-10 11:13:37 stefan Exp $'
 !
 
 version_HG
--- a/Class.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Class.st	Tue Aug 20 00:07:19 2013 +0100
@@ -918,16 +918,16 @@
      position within the classes sourcefile ...
     "
     comment isNumber ifTrue:[
-	classFilename notNil ifTrue:[
-	    stream := self sourceStream.
-	    stream notNil ifTrue:[
-		stream position1Based:comment.
-		string := String readFrom:stream onError:''.
-		stream close.
-		^ string
-	    ].
-	    ^ nil
-	]
+        classFilename notNil ifTrue:[
+            stream := self sourceStream.
+            stream notNil ifTrue:[
+                stream position:comment-1.
+                string := String readFrom:stream onError:''.
+                stream close.
+                ^ string
+            ].
+            ^ nil
+        ]
     ].
     ^ comment
 
@@ -3555,15 +3555,15 @@
 
     pos isNumber ifTrue:[
 "/        classFilename notNil ifTrue:[
-	    stream := self sourceStream.
-	    stream notNil ifTrue:[
-		stream position0Based:pos.
-		string := stream nextChunk.
-		stream close.
-		^ string
-	    ].
+            stream := self sourceStream.
+            stream notNil ifTrue:[
+                stream position:pos.
+                string := stream nextChunk.
+                stream close.
+                ^ string
+            ].
 "/        ].
-	^ nil
+        ^ nil
     ].
 
     ^ pos
@@ -5277,14 +5277,14 @@
      versionFromCode versionFromSource oldPos pos src rev|
 
     ValidateSourceOnlyOnce == true ifTrue:[
-	ValidatedClasses notNil ifTrue:[
-	    (ValidatedClasses includes:self) ifTrue:[
-		Transcript showCR:'trust validated'.
-		^ true
-	    ].
-	] ifFalse:[
-	    ValidatedClasses := WeakIdentitySet new.
-	].
+        ValidatedClasses notNil ifTrue:[
+            (ValidatedClasses includes:self) ifTrue:[
+                Transcript showCR:'trust validated'.
+                ^ true
+            ].
+        ] ifFalse:[
+            ValidatedClasses := WeakIdentitySet new.
+        ].
     ].
 
     meta := self theMetaclass.
@@ -5294,75 +5294,75 @@
 
     versionMethod := self findVersionMethod.
     versionMethod isNil ifTrue:[
-	cannotCheckReason := 'no valid version method'.
+        cannotCheckReason := 'no valid version method'.
     ] ifFalse:[
-	"/
-	"/ if its a method returning the string,
-	"/ thats the returned value
-	"/
-	versionFromCode := versionMethod valueWithReceiver:cls arguments:#().
-	versionFromCode isString ifFalse:[
-	    cannotCheckReason := 'version method does not return a string'
-	].
+        "/
+        "/ if its a method returning the string,
+        "/ thats the returned value
+        "/
+        versionFromCode := versionMethod valueWithReceiver:cls arguments:#().
+        versionFromCode isString ifFalse:[
+            cannotCheckReason := 'version method does not return a string'
+        ].
     ].
 
     versionMethod notNil ifTrue:[
-	pos := versionMethod sourcePosition.
-	pos isInteger ifFalse:[
-	    "/ mhmh - either no version method,
-	    "/ or updated due to a checkin.
-	    "/ in any case, this should be a good source.
-
-	    ^ true.
-	    "/ cannotCheckReason := 'no source position for version-method'
-	]
+        pos := versionMethod sourcePosition.
+        pos isInteger ifFalse:[
+            "/ mhmh - either no version method,
+            "/ or updated due to a checkin.
+            "/ in any case, this should be a good source.
+
+            ^ true.
+            "/ cannotCheckReason := 'no source position for version-method'
+        ]
     ].
 
     cannotCheckReason notNil ifTrue:[
-	('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
-	'Class [info]: cannot validate source; trusting source' infoPrintCR.
-	^ true
+        ('Class [warning]: ' , cannotCheckReason , ' in ' , self name) infoPrintCR.
+        'Class [info]: cannot validate source; trusting source' infoPrintCR.
+        ^ true
     ].
 
     oldPos := aStream position.
     Stream positionErrorSignal handle:[:ex |
-	'Class [info]: position error when accessing source' infoPrintCR.
-	^ false
+        'Class [info]: position error when accessing source' infoPrintCR.
+        ^ false
     ] do:[
-	aStream position1Based:pos.
+        aStream position:pos-1.
     ].
     src := aStream nextChunk.
     aStream position:oldPos.
 
     (src isEmptyOrNil) ifTrue:[
-	'Class [info]: empty source for version-method' infoPrintCR.
-	^ false
+        'Class [info]: empty source for version-method' infoPrintCR.
+        ^ false
     ].
     (src startsWith:'version') ifFalse:[
-	'Class [info]: corrupted source (source does not correspond to binary)' infoPrintCR.
-	^ false
+        'Class [info]: corrupted source (source does not correspond to binary)' infoPrintCR.
+        ^ false
     ].
 
     versionFromSource := Class revisionStringFromSource:src.
     versionFromSource = versionFromCode ifTrue:[
-	ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
-	^ true
+        ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
+        ^ true
     ].
 
     versionFromSource isNil ifTrue:[
-	'Class [info]: version-from source is nil' infoPrintCR.
-	^ false
+        'Class [info]: version-from source is nil' infoPrintCR.
+        ^ false
     ].
 
     "/ mhmh - check my binary version ...
 
     info := Class revisionInfoFromString:versionFromSource.
     info notNil ifTrue:[
-	rev := info at:#revision.
-	rev = self binaryRevision ifTrue:[
-	    ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
-	    ^ true
-	].
+        rev := info at:#revision.
+        rev = self binaryRevision ifTrue:[
+            ValidatedClasses notNil ifTrue:[ ValidatedClasses add:self ].
+            ^ true
+        ].
     ].
     'Class [info]: source-version is different from binaryRevision' infoPrintCR.
     ^ false
@@ -5646,11 +5646,11 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.628 2013-07-12 13:56:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.629 2013-08-10 11:14:10 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.628 2013-07-12 13:56:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.629 2013-08-10 11:14:10 stefan Exp $'
 !
 
 version_HG
--- a/ClassCategoryReader.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ClassCategoryReader.st	Tue Aug 20 00:07:19 2013 +0100
@@ -169,7 +169,7 @@
 !ClassCategoryReader class methodsFor:'others'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassCategoryReader.st,v 1.53 2011-07-31 07:30:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassCategoryReader.st,v 1.54 2013-08-10 11:14:34 stefan Exp $'
 ! !
 
 !ClassCategoryReader methodsFor:'fileIn'!
@@ -297,7 +297,7 @@
         done := aStream atEnd.
         done ifFalse:[
             canMakeSourceRef ifTrue:[
-                pos := aStream position1Based
+                pos := aStream position + 1
             ].
             aString := aStream nextChunk.
             aStream skipSeparators.
@@ -343,7 +343,7 @@
                                     SourceMode == #sourceReference ifTrue:[
                                         s := sourceFile asFilename appendingWriteStream.
                                         s setToEnd.     
-                                        pos := s position1Based.
+                                        pos := s position + 1.
                                         s nextChunkPut:src.
                                         s close.
                                     ].
@@ -440,7 +440,8 @@
 !ClassCategoryReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassCategoryReader.st,v 1.53 2011-07-31 07:30:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassCategoryReader.st,v 1.54 2013-08-10 11:14:34 stefan Exp $'
 ! !
 
+
 ClassCategoryReader initialize!
--- a/Collection.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Collection.st	Tue Aug 20 00:07:19 2013 +0100
@@ -3674,7 +3674,7 @@
     ] ifFalse:[
         s := WriteStream on:(String uninitializedNew:50).
     ].
-    limit := s position1Based + self maxPrint.
+    limit := s position + self maxPrint.
 
     self printElementsDo:[:element |
         firstOne ifFalse:[
@@ -3682,7 +3682,7 @@
         ] ifTrue:[
             firstOne := false
         ].
-        (s position1Based >= limit) ifTrue:[
+        (s position >= limit) ifTrue:[
             s ~~ aStream ifTrue:[
                 aStream nextPutAll:(s contents).
             ].
@@ -4842,11 +4842,11 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.308 2013-07-04 15:47:07 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.309 2013-08-10 11:14:45 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.308 2013-07-04 15:47:07 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.309 2013-08-10 11:14:45 stefan Exp $'
 ! !
 
 
--- a/Delay.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Delay.st	Tue Aug 20 00:07:19 2013 +0100
@@ -162,11 +162,7 @@
 
 until:aTimeStamp
     "return a new Delay object, that will delay the active process
-     until the system has reached the time represented by the argument.
-     BUG:
-        due to the limited range of the millisecondTimer, this can 
-        (currently) not be used for long delays. The maximum supported
-        delay is returned by OperatingSystem>>maximumMillisecondTimeDelta."
+     until the system has reached the time represented by the argument."
 
     |numberOfMilliseconds|
 
@@ -176,8 +172,7 @@
 
 untilMilliseconds:aMillisecondTime
     "return a new Delay object, that will delay the active process
-     until the systems millisecond time has reached aMillisecondTime.
-    "
+     until the systems millisecond time has reached aMillisecondTime."
 
     ^ self new resumptionTime:aMillisecondTime
 
@@ -364,10 +359,10 @@
 !Delay class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.47 2013-07-25 09:35:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.48 2013-08-16 09:38:32 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.47 2013-07-25 09:35:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.48 2013-08-16 09:38:32 stefan Exp $'
 ! !
 
--- a/EncodedStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/EncodedStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -381,27 +381,31 @@
 !
 
 position0Based
+    <resource: #obsolete>
     "to be obsoleted - use position"
 
-    ^ stream position0Based
+    ^ stream position
 !
 
 position0Based:newPosition
+    <resource: #obsolete>
     "to be obsoleted - use position"
 
-    stream position0Based:newPosition
+    stream position:newPosition
 !
 
 position1Based
+    <resource: #obsolete>
     "to be obsoleted - use position"
 
-    ^ stream position1Based
+    ^ stream position + 1
 !
 
 position1Based:newPosition
+    <resource: #obsolete>
     "to be obsoleted - use position"
 
-    stream position1Based:newPosition
+    stream position:newPosition-1
 !
 
 position:newPosition
@@ -502,11 +506,11 @@
 !EncodedStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.32 2013-08-01 10:55:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.33 2013-08-10 11:31:31 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.32 2013-08-01 10:55:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.33 2013-08-10 11:31:31 stefan Exp $'
 !
 
 version_HG
--- a/ExternalStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ExternalStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -4270,11 +4270,11 @@
 
 !ExternalStream methodsFor:'positioning'!
 
-position0Based
+position
     self subclassResponsibility
 !
 
-position0Based:index0Based
+position:index0Based
     self subclassResponsibility
 ! !
 
@@ -4980,16 +4980,16 @@
 
     buffer := self contentsSpecies new:4096.
     [self atEnd] whileFalse:[
-	count := self nextAvailableBytes:4096 into:buffer startingAt:1.
-	count ~~ 0 ifTrue:[
-	    answerStream isNil ifTrue:[
-		answerStream := WriteStream with:buffer.
-		answerStream position0Based:count.
-		buffer := self contentsSpecies new:4096.
-	    ] ifFalse:[
-		answerStream nextPutAll:buffer startingAt:1 to:count.
-	    ].
-	].
+        count := self nextAvailableBytes:4096 into:buffer startingAt:1.
+        count ~~ 0 ifTrue:[
+            answerStream isNil ifTrue:[
+                answerStream := WriteStream with:buffer.
+                answerStream position:count.
+                buffer := self contentsSpecies new:4096.
+            ] ifFalse:[
+                answerStream nextPutAll:buffer startingAt:1 to:count.
+            ].
+        ].
     ].
     answerStream isNil ifTrue:[^ self contentsSpecies new].
     ^ answerStream contents
@@ -5764,11 +5764,11 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.371 2013-07-09 11:56:22 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.372 2013-08-10 11:31:57 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.371 2013-07-09 11:56:22 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.372 2013-08-10 11:31:57 stefan Exp $'
 ! !
 
 
--- a/FileDirectory.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/FileDirectory.st	Tue Aug 20 00:07:19 2013 +0100
@@ -15,7 +15,7 @@
 	instanceVariableNames:'pathName lazy'
 	classVariableNames:'PathOfCurrentDirectory'
 	poolDictionaries:''
-	category:'Obsolete'
+	category:'Compatibility-Squeak'
 !
 
 ArrayedCollection subclass:#DirectoryEntry
@@ -45,10 +45,10 @@
 "
     Notice:
         This class is obsolete and does work only under UNIX. 
-        Use Filename instead.
+        Use Filename instead. It is left here for squeak compatibility.
 
         This class is not available in other ST-systems;
-        in contrast, ST-80 provides a Filename class.
+        in contrast, VisualWorks provides a Filename class.
         Therefore, Filename has taken over the functionality.
 
     FileDirectories represent directories in the underlying host system.
@@ -310,6 +310,15 @@
     ^ self exists:name
 !
 
+oldFileNamed:fn
+    "Squeak/ST80 compatibility"
+
+    |f|
+
+    f := self filenameFor:fn.
+    ^ f readStream
+!
+
 readOnlyFileNamed:fn
     "Squeak/ST80 compatibility"
 
@@ -817,11 +826,12 @@
 !FileDirectory class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.53 2012-08-31 17:57:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.54 2013-08-16 11:49:12 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.53 2012-08-31 17:57:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.54 2013-08-16 11:49:12 cg Exp $'
 ! !
 
+
 FileDirectory initialize!
--- a/FileStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/FileStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -876,19 +876,19 @@
      Therefore, this method is reimplemented here (from ExternalStream)"
 
     outStream isExternalStream ifTrue:[
-	pos := self position0Based.
-	n := self size - pos.
-	nWritten := OperatingSystem
-	    copyFromFd:(self fileDescriptor)
-	    toFd:(outStream fileDescriptor)
-	    startIndex:pos
-	    count:n.
-	nWritten = n ifTrue:[
-	    ^ self
-	].
-	nWritten > 0 ifTrue:[
-	    self position0Based:pos+nWritten.
-	].
+        pos := self position.
+        n := self size - pos.
+        nWritten := OperatingSystem
+            copyFromFd:(self fileDescriptor)
+            toFd:(outStream fileDescriptor)
+            startIndex:pos
+            count:n.
+        nWritten = n ifTrue:[
+            ^ self
+        ].
+        nWritten > 0 ifTrue:[
+            self position:pos+nWritten.
+        ].
     ].
     ^ super copyToEndInto:outStream bufferSize:bufferSize.
 
@@ -904,7 +904,7 @@
 
 !FileStream methodsFor:'positioning'!
 
-position0Based
+position
     "return the read/write position in the file"
 
 %{
@@ -913,54 +913,54 @@
     off_t currentPosition;
 
     if (__INST(handle) != nil) {
-	do {
-	    f = __FILEVal(__INST(handle));
+        do {
+            f = __FILEVal(__INST(handle));
 #ifdef WIN32
-	    __threadErrno = 0;
-	    if (__INST(buffered) == true) {
+            __threadErrno = 0;
+            if (__INST(buffered) == true) {
 # if 0
-		currentPosition = STX_C_CALL1( "ftell", ftell, f);
+                currentPosition = STX_C_CALL1( "ftell", ftell, f);
 # else
-		currentPosition = ftell(f);
+                currentPosition = ftell(f);
 # endif
-	    } else {
-		OBJ rA = __INST(readAhead);
-		off_t offs = 0;
+            } else {
+                OBJ rA = __INST(readAhead);
+                off_t offs = 0;
 
-		if (rA != nil) {
-		    __INST(readAhead) = nil;
-		    offs = -1;
-		}
+                if (rA != nil) {
+                    __INST(readAhead) = nil;
+                    offs = -1;
+                }
 # if 0
-		currentPosition = STX_C_CALL3( "lseek", lseek, fileno(f), offs, SEEK_CUR);
+                currentPosition = STX_C_CALL3( "lseek", lseek, fileno(f), offs, SEEK_CUR);
 # else
-		currentPosition = lseek(fileno(f), offs, SEEK_CUR);
+                currentPosition = lseek(fileno(f), offs, SEEK_CUR);
 # endif
-	    }
+            }
 #else /* !WIN32 */
-	    if (__INST(buffered) == true) {
+            if (__INST(buffered) == true) {
 #ifdef _LFS_LARGEFILE
-		currentPosition = ftello(f);
+                currentPosition = ftello(f);
 #else
-		currentPosition = ftell(f);
+                currentPosition = ftell(f);
 #endif /* ! _LFS_LARGEFILE */
-	    } else {
-		currentPosition = lseek(fileno(f), (off_t)0, SEEK_CUR);
-	    }
+            } else {
+                currentPosition = lseek(fileno(f), (off_t)0, SEEK_CUR);
+            }
 #endif /* !WIN32 */
-	} while ((currentPosition < 0) && (__threadErrno == EINTR));
+        } while ((currentPosition < 0) && (__threadErrno == EINTR));
 
-	if (currentPosition >= 0) {
-	    OBJ rslt;
+        if (currentPosition >= 0) {
+            OBJ rslt;
 
-	    if (sizeof(currentPosition) == 8) {
-		rslt = __MKINT64 (&currentPosition);
-	    } else {
-		rslt = __MKINT(currentPosition);
-	    }
-	    RETURN ( rslt );
-	}
-	__INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
+            if (sizeof(currentPosition) == 8) {
+                rslt = __MKINT64 (&currentPosition);
+            } else {
+                rslt = __MKINT(currentPosition);
+            }
+            RETURN ( rslt );
+        }
+        __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
     }
 %}.
     lastErrorNumber notNil ifTrue:[^ self ioError].
@@ -968,7 +968,7 @@
     ^ self primitiveFailed
 !
 
-position0Based:newPos
+position:newPos
     "set the read/write position in the file"
 
     |rslt|
@@ -979,95 +979,95 @@
     OBJ fp;
 
     if ((__INST(canPosition) != false) || (newPos == __mkSmallInteger(0))) {
-	if ((fp = __INST(handle)) != nil) {
+        if ((fp = __INST(handle)) != nil) {
 
 #if defined(_LFS_LARGE_FILE) && !defined(WIN32)
 # define FSEEK fseeko
-	    off_t nP;
+            off_t nP;
 #else
 #define FSEEK fseek
-	    long nP;
+            long nP;
 #endif
 
-	    if (__isSmallInteger(newPos)) {
-		nP = __intVal(newPos);
-		if (nP < 0) {
-		    __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
-		    goto getOutOfHere;
-		}
-	    } else {
-		nP = __signedLongIntVal(newPos);
-		if (nP < 0) {
-		    __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
-		    goto getOutOfHere;
-		}
-		if (nP == 0) {
-		    if (sizeof(nP) == 8) {
-			if (__signedLong64IntVal(newPos, &nP) == 0 || nP < 0) {
-			    __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
-			    goto getOutOfHere;
-			}
-		    } else {
-			__INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
-			goto getOutOfHere;
-		    }
-		}
-	    }
+            if (__isSmallInteger(newPos)) {
+                nP = __intVal(newPos);
+                if (nP < 0) {
+                    __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
+                    goto getOutOfHere;
+                }
+            } else {
+                nP = __signedLongIntVal(newPos);
+                if (nP < 0) {
+                    __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
+                    goto getOutOfHere;
+                }
+                if (nP == 0) {
+                    if (sizeof(nP) == 8) {
+                        if (__signedLong64IntVal(newPos, &nP) == 0 || nP < 0) {
+                            __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
+                            goto getOutOfHere;
+                        }
+                    } else {
+                        __INST(lastErrorNumber) = __mkSmallInteger(EINVAL);
+                        goto getOutOfHere;
+                    }
+                }
+            }
 
-	    f = __FILEVal(fp);
+            f = __FILEVal(fp);
 
-	    do {
+            do {
 #if defined(DO_WRAP_CALL_FSEEK)
-		__threadErrno = 0;
-		if (__INST(buffered) == true) {
-		    ret = STX_C_CALL3( "fseek", fseek, f, nP, SEEK_SET);
-		} else {
-		    __INST(readAhead) = nil;
-		    ret = STX_C_CALL3( "lseek", lseek, fileno(f), nP, SEEK_SET);
-		}
+                __threadErrno = 0;
+                if (__INST(buffered) == true) {
+                    ret = STX_C_CALL3( "fseek", fseek, f, nP, SEEK_SET);
+                } else {
+                    __INST(readAhead) = nil;
+                    ret = STX_C_CALL3( "lseek", lseek, fileno(f), nP, SEEK_SET);
+                }
 #else
-		if (__INST(buffered) == true) {
-		    ret = FSEEK(f, nP, SEEK_SET);
-		} else {
-		    ret = lseek(fileno(f), nP, SEEK_SET);
-		}
-		__threadErrno = errno;
+                if (__INST(buffered) == true) {
+                    ret = FSEEK(f, nP, SEEK_SET);
+                } else {
+                    ret = lseek(fileno(f), nP, SEEK_SET);
+                }
+                __threadErrno = errno;
 #endif
-	    } while ((ret < 0) && (__threadErrno == EINTR));
-	    if (ret >= 0) {
-		__INST(position) = newPos; __STORE(self, newPos);
-		/*
-		 * just to make certain ...
-		 */
-		__INST(hitEOF) = false;
-		RETURN ( self );
-	    }
-	    __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
-	}
+            } while ((ret < 0) && (__threadErrno == EINTR));
+            if (ret >= 0) {
+                __INST(position) = newPos; __STORE(self, newPos);
+                /*
+                 * just to make certain ...
+                 */
+                __INST(hitEOF) = false;
+                RETURN ( self );
+            }
+            __INST(lastErrorNumber) = __mkSmallInteger(__threadErrno);
+        }
     }
     getOutOfHere: ;
 #undef FSEEK
 %}.
     canPosition == false ifTrue:[
-	"/ position by rewinding & re-reading everything up-to
-	"/ that point.
-	^ self slowPosition0Based:newPos
+        "/ position by rewinding & re-reading everything up-to
+        "/ that point.
+        ^ self slowPosition:newPos
     ].
     lastErrorNumber notNil ifTrue:[
-	(OperatingSystem errorSymbolForNumber:lastErrorNumber) == #EINVAL ifTrue:[
-	    "/ invalid position
-	    ^ self positionError
-	].
-	"/ assume I/O error
-	^ self ioError
+        (OperatingSystem errorSymbolForNumber:lastErrorNumber) == #EINVAL ifTrue:[
+            "/ invalid position
+            ^ self positionError
+        ].
+        "/ assume I/O error
+        ^ self ioError
     ].
     handle isNil ifTrue:[^ self errorNotOpen].
 
     rslt := self positionFile:handle position:newPos.
     rslt >= 0 ifTrue:[
-	position := newPos.
+        position := newPos.
     ] ifFalse:[
-	hitEOF := true.
+        hitEOF := true.
     ]
 !
 
@@ -1132,47 +1132,36 @@
     ^ self primitiveFailed
 !
 
-slowPosition0Based:newPos
-    "position the file by re-reading everything up-to newPos.
-     The effect is the same as that of #position:, but its much slower.
-     This is required to reposition nonPositionable streams, such
-     as tape-streams or variable-record-RMS files under VMS.
-     Caveat:
-	 This should really be done transparently by the stdio library."
-
-    |buffer amount pos0Based|
-
-    self isReadable ifFalse:[
-	"/ sorry
-	^ self positionError
-    ].
-
-    buffer := ByteArray new:8*1024.
-
-    (position isNil "/ i.e. unknown
-    or:[newPos < (pos0Based := self position0Based)]) ifTrue:[
-	self reset.
-	pos0Based := self position0Based.
-    ].
-    [pos0Based < newPos] whileTrue:[
-	amount := (buffer size) min:(newPos-pos0Based).
-	(self nextBytes:amount into:buffer startingAt:1) ~~ amount ifTrue:[
-	    ^ self positionError
-	].
-	pos0Based := self position0Based.
-    ].
-    "/ ('FileStream [info]: slow position - please convert ''' , pathName printString , ''' to streamLF format') infoPrintCR.
-!
-
 slowPosition:newPos
     "position the file by re-reading everything up-to newPos.
      The effect is the same as that of #position:, but its much slower.
      This is required to reposition nonPositionable streams, such
      as tape-streams or variable-record-RMS files under VMS.
      Caveat:
-	 This should really be done transparently by the stdio library."
+         This should really be done transparently by the stdio library."
+
+    |buffer amount pos0Based|
+
+    self isReadable ifFalse:[
+        "/ sorry
+        ^ self positionError
+    ].
+
+    buffer := ByteArray new:8*1024.
 
-    ^ self slowPosition0Based:newPos
+    (position isNil "/ i.e. unknown
+    or:[newPos < (pos0Based := self position)]) ifTrue:[
+        self reset.
+        pos0Based := self position.
+    ].
+    [pos0Based < newPos] whileTrue:[
+        amount := (buffer size) min:(newPos-pos0Based).
+        (self nextBytes:amount into:buffer startingAt:1) ~~ amount ifTrue:[
+            ^ self positionError
+        ].
+        pos0Based := self position.
+    ].
+    "/ ('FileStream [info]: slow position - please convert ''' , pathName printString , ''' to streamLF format') infoPrintCR.
 ! !
 
 !FileStream methodsFor:'printing & storing'!
@@ -1998,11 +1987,11 @@
 !FileStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.168 2013-07-29 08:11:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.169 2013-08-10 11:32:53 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.168 2013-07-29 08:11:37 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.169 2013-08-10 11:32:53 stefan Exp $'
 ! !
 
 
--- a/FixedPoint.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/FixedPoint.st	Tue Aug 20 00:07:19 2013 +0100
@@ -245,7 +245,7 @@
             fractionStream nextPut:char
         ].
 
-        scale := fractionStream position0Based.
+        scale := fractionStream position.
         fractionStream reset.
         fractionPart := Number readFrom:fractionStream.
     ].
@@ -289,6 +289,7 @@
     "
 ! !
 
+
 !FixedPoint class methodsFor:'printing control'!
 
 printTruncated
@@ -1351,9 +1352,10 @@
 !FixedPoint class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.45 2010-11-23 13:39:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.46 2013-08-10 11:15:37 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.45 2010-11-23 13:39:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.46 2013-08-10 11:15:37 stefan Exp $'
 ! !
+
--- a/GenericException.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/GenericException.st	Tue Aug 20 00:07:19 2013 +0100
@@ -173,7 +173,8 @@
 
 initialize
     NotifierString := 'unknown exception'.
-    StrictRaising := false.     "set to true to check whether a signal may be raised proceedable"
+    "force strict signal checking in Smalltalk development - nobody cares otherwise"
+    StrictRaising := Smalltalk isStandAloneApp not.     "set to true to check whether a signal may be raised proceedable"
 
     "Modified: / 04-08-1999 / 09:06:26 / stefan"
     "Modified: / 17-11-2010 / 17:53:13 / cg"
@@ -1567,12 +1568,11 @@
 
     |con rCon|
 
-"/    proceedable ifFalse:[
-"/        "proceed from ProceedError to recover from this error"
-"/        ProceedError raiseRequestWith:self.
-"/        proceedable := true.
-"/    ].
-
+    (StrictRaising and:[proceedable not]) ifTrue:[
+        "proceed from ProceedError to recover from this error"
+        ProceedError raiseRequestWith:self.
+        proceedable := true.
+    ].
 
     thisContext evaluateUnwindActionsUpTo:suspendedContext.
 
@@ -2355,11 +2355,11 @@
 !GenericException class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.143 2013-07-30 19:18:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.144 2013-08-16 17:55:22 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.143 2013-07-30 19:18:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.144 2013-08-16 17:55:22 stefan Exp $'
 !
 
 version_HG
--- a/HashStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/HashStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -110,6 +110,13 @@
 
 !HashStream class methodsFor:'queries'!
 
+blockSize
+    "return the block size when the hash is used by encryption/decryption.
+     (see OfbCipherMode and CtrCipherMode)"
+
+    ^ self hashSize
+!
+
 canStream
     "simple hash functions (squeak-ported) cannot stream.
      Use hashFunction: there"
@@ -117,6 +124,12 @@
     ^ true
 !
 
+hashBlockSize
+    "return the block size used internally by the compression function"
+    
+    self subclassResponsibility
+!
+
 hashSize
     "return the size of the hashvalue returned by instances of this class (in bytes)"
 
@@ -171,6 +184,42 @@
 
 !HashStream class methodsFor:'utilities'!
 
+cryptBlock:aStringOrByteArray from:srcIdx into:resultOrNil startingAt:dstIdx encrypt:encryptMode
+    "one-way encryption of aStringOrByteArray.
+     Used when a HashStream is used as the block copher with OFB or CTR mode.
+
+     encryptMode is ignored here."
+
+    |hashValue|
+
+    srcIdx == 1 ifTrue:[
+        hashValue := self hashValueOf:aStringOrByteArray.
+    ] ifFalse:[
+        |bytesToEncrypt|
+
+        bytesToEncrypt := aStringOrByteArray copyFrom:srcIdx to:srcIdx+self hashSize-1.
+        hashValue := self hashValueOf:bytesToEncrypt.
+    ].
+    resultOrNil isNil ifTrue:[
+        ^ hashValue.
+    ] ifFalse:[
+        resultOrNil replaceBytesFrom:dstIdx to:dstIdx+hashValue size-1 with:hashValue startingAt:1.
+        ^ resultOrNil.
+    ].
+
+    "
+        |cipher iv cipherText|
+
+        cipher := OfbCipher for:SHA512Stream.
+        iv := cipher randomInitializationVector.
+        cipherText := cipher encrypt:'Hello world, here is the alien from Mars and 1234567890' asByteArray.
+        self information:cipherText printString.
+
+        cipher initializationVector:iv.
+        self information:(cipher decrypt:cipherText) asString.
+    "
+!
+
 digestMessage:aStringOrByteArrayOrStream
     ^ self hashValueOf:aStringOrByteArrayOrStream
 !
@@ -273,6 +322,12 @@
     "Created: / 18.3.1999 / 10:17:02 / stefan"
 !
 
+hashBlockSize
+    "the class knows about the basic block size"
+    
+    ^ self class hashBlockSize
+!
+
 hashSize
     "return the size of the returned hashvalue (in bytes)"
 
@@ -389,10 +444,10 @@
 !HashStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/HashStream.st,v 1.27 2013-03-08 23:37:43 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/HashStream.st,v 1.29 2013-08-11 22:25:34 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/HashStream.st,v 1.27 2013-03-08 23:37:43 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/HashStream.st,v 1.29 2013-08-11 22:25:34 stefan Exp $'
 ! !
 
--- a/LargeInteger.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/LargeInteger.st	Tue Aug 20 00:07:19 2013 +0100
@@ -1082,19 +1082,16 @@
      Here, a specially tuned version for largeInteger arguments
      (to speed up some cryptographic code)"
 
-    |len1 len2
-     "/ n "{ Class: SmallInteger }"
-     "/ result byte
-     newBytes|
+    |len1 len2 newBytes|
 
     anInteger class ~~ LargeInteger ifTrue:[^ super bitXor:anInteger].
 
     (len1 := anInteger digitLength) > (len2 := self digitLength) ifTrue:[
-	newBytes := anInteger digitBytes copy.
-	newBytes bitXorBytesFrom:1 to:len2 with:digitByteArray startingAt:1
+        newBytes := anInteger digitBytes copy.
+        newBytes bitXorBytesFrom:1 to:len2 with:digitByteArray startingAt:1
     ] ifFalse:[
-	newBytes := digitByteArray copy.
-	newBytes bitXorBytesFrom:1 to:len1 with:anInteger digits startingAt:1
+        newBytes := digitByteArray copy.
+        newBytes bitXorBytesFrom:1 to:len1 with:anInteger digits startingAt:1
     ].
     ^ (LargeInteger digitBytes:newBytes) compressed
 
@@ -1109,9 +1106,9 @@
      bigNum1 := 2 raisedToInteger:512.
      bigNum2 := 2 raisedToInteger:510.
      Time millisecondsToRun:[
-	1000000 timesRepeat:[
-	   bigNum1 bitXor:bigNum2.
-	]
+        1000000 timesRepeat:[
+           bigNum1 bitXor:bigNum2.
+        ]
      ]
     "
 !
@@ -5230,10 +5227,10 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.212 2013-07-30 10:56:22 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.213 2013-08-12 10:09:58 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.212 2013-07-30 10:56:22 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.213 2013-08-12 10:09:58 stefan Exp $'
 ! !
 
--- a/MD5Stream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/MD5Stream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -237,9 +237,9 @@
 
 !MD5Stream class methodsFor:'queries'!
 
-blockSize
+hashBlockSize
     "return the block size used internally by the compression function"
-
+    
     ^ 64
 
     "Created: / 18.3.1999 / 08:36:44 / stefan"
@@ -386,11 +386,11 @@
 !MD5Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/MD5Stream.st,v 1.25 2013-02-20 15:39:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/MD5Stream.st,v 1.26 2013-08-11 22:25:55 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/MD5Stream.st,v 1.25 2013-02-20 15:39:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/MD5Stream.st,v 1.26 2013-08-11 22:25:55 stefan Exp $'
 ! !
 
 
--- a/Method.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Method.st	Tue Aug 20 00:07:19 2013 +0100
@@ -2253,7 +2253,7 @@
     PositionError handle:[:ex |
         ^ nil
     ] do:[
-        aStream position1Based:(sourcePosition ? 1) abs.
+        aStream position:(sourcePosition ? 1) abs - 1.
     ].
     ^ aStream nextChunk.
 !
@@ -3853,11 +3853,11 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.421 2013-07-30 13:55:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.422 2013-08-10 11:22:40 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.421 2013-07-30 13:55:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.422 2013-08-10 11:22:40 stefan Exp $'
 !
 
 version_HG
--- a/ObjectMemory.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ObjectMemory.st	Tue Aug 20 00:07:19 2013 +0100
@@ -5287,7 +5287,7 @@
      ST-80 compatibility; send #preSnapshot to all classes
     "
     Smalltalk allClassesDo:[:aClass |
-	aClass preSnapshot
+        aClass preSnapshot
     ].
 
     "
@@ -5296,52 +5296,54 @@
      (could be ST/X error or file-system errors etc.)
     "
     snapshotFilename := aFileName asFilename.
-    tempFilename := snapshotFilename withSuffix:'tmp'.
+    tempFilename := (FileStream newTemporaryIn:snapshotFilename directory)
+                        close;
+                        fileName.
     ok := self primSnapShotOn:tempFilename.
 
     ok ifTrue:[
-	"keep history of one snapshot file"
-	snapshotFilename exists ifTrue:[
-	    tempFilename symbolicAccessRights:snapshotFilename symbolicAccessRights.
-	    snapshotFilename renameTo:(snapshotFilename withSuffix:'sav').
-	] ifFalse:[
-	    "image file hat stx as interpreter and can be executed"
-	    tempFilename makeExecutable.
-	].
-	tempFilename renameTo:snapshotFilename.
-
-	Class addChangeRecordForSnapshot:aFileName.
-
-	setImageName ifTrue:[
-	    oldChangeFile := self nameForChanges.
-	    ImageName := snapshotFilename asAbsoluteFilename asString.
-	    self refreshChangesFrom:oldChangeFile.
-	].
+        "keep history of one snapshot file"
+        snapshotFilename exists ifTrue:[
+            tempFilename symbolicAccessRights:snapshotFilename symbolicAccessRights.
+            snapshotFilename renameTo:(snapshotFilename withSuffix:'sav').
+        ] ifFalse:[
+            "image file hat stx as interpreter and can be executed"
+            tempFilename makeExecutable.
+        ].
+        tempFilename renameTo:snapshotFilename.
+
+        Class addChangeRecordForSnapshot:aFileName.
+
+        setImageName ifTrue:[
+            oldChangeFile := self nameForChanges.
+            ImageName := snapshotFilename asAbsoluteFilename asString.
+            self refreshChangesFrom:oldChangeFile.
+        ].
     ] ifFalse:[
-	tempFilename remove.
+        tempFilename remove.
     ].
 
     "
      ST-80 compatibility; send #postSnapshot to all classes
     "
     Smalltalk allClassesDo:[:aClass |
-	aClass postSnapshot
+        aClass postSnapshot
     ].
     self changed:#finishedSnapshot.  "/ ST-80 compatibility
 
     ok ifFalse:[
-	SnapshotError raise.
-	"not reached"
+        SnapshotError raise.
+        "not reached"
     ].
 
     Transcript
-	show:'Snapshot ';
-	show:snapshotFilename baseName allBold;
-	show:' saved ';
-	show:Timestamp now;
-	show:' in ';
-	show:snapshotFilename asAbsoluteFilename directoryName;
-	showCR:'.'.
+        show:'Snapshot ';
+        show:snapshotFilename baseName allBold;
+        show:' saved ';
+        show:Timestamp now;
+        show:' in ';
+        show:snapshotFilename asAbsoluteFilename directoryName;
+        showCR:'.'.
 
     ^ ok
 
@@ -5504,7 +5506,7 @@
 !ObjectMemory class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.270 2013-07-05 11:17:47 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.271 2013-08-16 17:38:47 stefan Exp $'
 !
 
 version_SVN
--- a/PositionableStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/PositionableStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -141,7 +141,6 @@
     "
 ! !
 
-
 !PositionableStream methodsFor:'accessing'!
 
 collection
@@ -230,34 +229,37 @@
 !
 
 position
-    "return the read position"
-
-    ^ self position0Based
-!
-
-position0Based
-    "return the read position 0-based"
+    "return the read position (0-based)"
 
     ^ position
 !
 
+position0Based
+    <resource: #obsolete>
+    "return the read position 0-based"
+
+    ^ self position
+!
+
 position0Based:index0Based
+    <resource: #obsolete>
     "set the read (or write) position"
 
-    ((index0Based > readLimit) or:[index0Based < 0]) ifTrue: [^ self positionError:index0Based].
-    position := index0Based
+    self position:index0Based
 !
 
 position1Based
+    <resource: #obsolete>
     "return the read position 1-based"
 
-    ^ self position0Based + 1
+    ^ self position + 1
 !
 
 position1Based:index1Based
+    <resource: #obsolete>
     "set the read (or write) position"
 
-    self position0Based:(index1Based - 1)
+    self position:(index1Based - 1)
 
     "
      |s|
@@ -289,39 +291,11 @@
     "
 !
 
-position:newPos
+position:index0Based
     "set the read (or write) position"
 
-    ^ self position0Based:newPos
-
-    "
-     |s|
-
-     s := '1234567890' readStream.
-     s next:5.
-     s position:1.
-     s next:7.       
-    "
-
-    "
-     |s|
-
-     s := '' writeStream.
-     s nextPutAll:'1234567890'.
-     s position:5.
-     s nextPutAll:'abcdefg'.
-     s contents 
-    "
-
-    "
-     |s|
-
-     s := '' writeStream.
-     s nextPutAll:'1234567890'.
-     s position:0.
-     s nextPutAll:'abcdefg'.
-     s contents 
-    "
+    ((index0Based > readLimit) or:[index0Based < 0]) ifTrue: [^ self positionError:index0Based].
+    position := index0Based
 !
 
 reset
@@ -492,7 +466,7 @@
 contentsSpecies
     "return a class of which instances will be returned, when
      parts of the collection are asked for. 
-     (see upTo-kind of methods in subclasses)"
+     (see upTo-kind of methods in Stream)"
 
     ^ collection species
 !
@@ -659,11 +633,11 @@
 !PositionableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.159 2013-06-03 18:39:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.161 2013-08-18 10:56:02 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.159 2013-06-03 18:39:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.161 2013-08-18 10:56:02 cg Exp $'
 ! !
 
 
--- a/ProcessorScheduler.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ProcessorScheduler.st	Tue Aug 20 00:07:19 2013 +0100
@@ -1761,25 +1761,25 @@
     |l s pri wasBlocked|
 
     "ignore, if process is already dead"
-    (aProcess isNil or:[aProcess id isNil]) ifTrue:[^ false].
+    (aProcess isNil or:[aProcess isDead]) ifTrue:[^ false].
 
     s := aProcess state.
     s == #osWait ifTrue:[
-	'Processor [warning]: bad resume: #osWait' errorPrintCR.
-	"/ MiniDebugger enterWithMessage:'bad resume: state osWait'.
-	^ false.
+        'Processor [warning]: bad resume: #osWait' errorPrintCR.
+        "/ MiniDebugger enterWithMessage:'bad resume: state osWait'.
+        ^ false.
     ].
     s == #stopped ifTrue:[
-	"by definition, stopped processes cannot be resumed"
-	^ false.
+        "by definition, stopped processes cannot be resumed"
+        ^ false.
     ].
 
     aProcess == activeProcess ifTrue:[
-	"special handling for waiting schedulers"
-	aProcess == scheduler ifTrue:[
-	    suspendScheduler := false.
-	].
-	^ false
+        "special handling for waiting schedulers"
+        aProcess == scheduler ifTrue:[
+            suspendScheduler := false.
+        ].
+        ^ false
     ].
 
     wasBlocked := OperatingSystem blockInterrupts.
@@ -1789,26 +1789,26 @@
     l := quiescentProcessLists at:pri.
     "if already running, ignore"
     l notNil ifTrue:[
-	(l identityIndexOf:aProcess) ~~ 0 ifTrue:[
-	    wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
-	    ^ false
-	]
+        (l identityIndexOf:aProcess) ~~ 0 ifTrue:[
+            wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
+            ^ false
+        ]
     ] ifFalse:[
-	l := LinkedList new.
-	quiescentProcessLists at:pri put:l.
+        l := LinkedList new.
+        quiescentProcessLists at:pri put:l.
     ].
     l addLast:aProcess.
     aProcess state:#run.
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 
     pri > currentPriority ifTrue:[
-	"must reschedule"
-	^ true.
+        "must reschedule"
+        ^ true.
     ].
 
     timeSliceNeededSemaphore notNil ifTrue:[
-	"/ tell timeslicer, that some work might be needed...
-	timeSliceNeededSemaphore signalIf.
+        "/ tell timeslicer, that some work might be needed...
+        timeSliceNeededSemaphore signalIf.
     ].
     ^ false.
 
@@ -3238,21 +3238,25 @@
 
     n := timeoutArray size.
     1 to:n do:[:index |
-	aTime := timeoutArray at:index.
-	aTime notNil ifTrue:[
-	    now isNil ifTrue:[
-		now := OperatingSystem getMillisecondTime.
-	    ].
-	    delta := OperatingSystem millisecondTimeDeltaBetween:aTime and:now.
-	    delta <= 0 ifTrue:[
-		^ 0.
-	    ].
-	    minDelta isNil ifTrue:[
-		minDelta := delta
-	    ] ifFalse:[
-		minDelta := minDelta min:delta
-	    ]
-	]
+        aTime := timeoutArray at:index.
+        aTime notNil ifTrue:[
+            now isNil ifTrue:[
+                now := OperatingSystem getMillisecondTime.
+            ].
+            delta := OperatingSystem millisecondTimeDeltaBetween:aTime and:now.
+            delta <= 0 ifTrue:[
+                ^ 0.
+            ].
+            minDelta isNil ifTrue:[
+                minDelta := delta
+            ] ifFalse:[
+                minDelta := minDelta min:delta
+            ]
+        ]
+    ].
+    minDelta isNil ifTrue:[
+        "this is safe, since always called with interruptsBlocked"
+        anyTimeouts := false.
     ].
 
     ^ minDelta
@@ -3377,11 +3381,11 @@
 !ProcessorScheduler class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.273 2013-07-30 17:38:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.274 2013-08-16 17:49:53 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.273 2013-07-30 17:38:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProcessorScheduler.st,v 1.274 2013-08-16 17:49:53 stefan Exp $'
 ! !
 
 
--- a/ReadStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/ReadStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -55,28 +55,6 @@
     ^ super with:aCollection
 ! !
 
-!ReadStream methodsFor:'Compatibility-Dolphin'!
-
-skipWhile:aBlock
-    "skip all elements for which aBlock returns true. Return true if more elements can be read,
-     false if eof has been reached."
-
-    [self atEnd] whileFalse:[
-	(aBlock value: self peek) ifFalse:[^ true].
-	self next
-    ].
-    ^ false
-
-    "
-     #(1 2 3 4 5 6 7 8 9 10) readStream
-	skipWhile:[:el | el <= 5];
-	next
-    "
-
-    "Created: / 23-09-2011 / 13:32:40 / cg"
-! !
-
-
 !ReadStream methodsFor:'converting'!
 
 readStream
@@ -868,10 +846,10 @@
 !ReadStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.71 2013-07-30 19:02:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.72 2013-08-18 10:13:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.71 2013-07-30 19:02:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.72 2013-08-18 10:13:59 cg Exp $'
 ! !
 
--- a/SHA1Stream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/SHA1Stream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -426,9 +426,9 @@
 
 !SHA1Stream class methodsFor:'queries'!
 
-blockSize
+hashBlockSize
     "return the block size used internally by the compression function"
-
+    
     ^ 64
 
     "Created: / 18.3.1999 / 08:37:10 / stefan"
@@ -582,11 +582,11 @@
 !SHA1Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.38 2013-04-03 10:32:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.39 2013-08-11 22:25:41 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.38 2013-04-03 10:32:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.39 2013-08-11 22:25:41 stefan Exp $'
 ! !
 
 
--- a/Semaphore.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Semaphore.st	Tue Aug 20 00:07:19 2013 +0100
@@ -442,24 +442,26 @@
      NOTE: Must be called when known that waitingProcesses is nonNil and
            also with blocked interrupts"
 
-    |processes anyDead currentPriority needsReschedule|
+    |processes anyDead needsReschedule|
 
     processes := waitingProcesses.
-"/ do not set to nil - a waiting process may be suspended and will not be resumed...
+"/ do not set to nil - a waiting process may be suspended and will not be resumed by #makeRunnable: ...
 "/    waitingProcesses := nil.
 
-    currentPriority := Processor currentPriority.
     needsReschedule := false.
     anyDead := false.
     processes do:[:eachProcess | 
-        (eachProcess isNil or:[eachProcess isDead]) ifTrue:[
-            Transcript show:'oops: a dead process: '; showCR:eachProcess.
-            anyDead := true.
+        (Processor makeRunnable:eachProcess) ifTrue:[
+            needsReschedule := true.
         ] ifFalse:[
-            (Processor makeRunnable:eachProcess) ifTrue:[
-                needsReschedule := true.
+            "if process is nil or dead (or for other reasons) makeRunnable returns false.
+             So check here."
+            (eachProcess isNil or:[eachProcess isDead]) ifTrue:[
+                "printing to Transcript might not be a good idea while interrupts are blocked"
+                'Semaphore>>wakeupWaiters: removing a dead process: ' infoPrint. eachProcess infoPrintCR.
+                anyDead := true.
             ].
-        ]
+        ].
     ].
     anyDead ifTrue:[
         "interrupts are already blocked by sender"
@@ -584,7 +586,7 @@
     wasBlocked := OperatingSystem blockInterrupts.
     [
         count := count + 1.
-        waitingProcesses notNil ifTrue:[
+        waitingProcesses size ~~ 0 ifTrue:[
             needsReschedule := self wakeupWaiters.
         ].
     ] ensure:[
@@ -605,7 +607,7 @@
 
     |wasBlocked needsReschedule|
 
-    waitingProcesses notNil ifTrue:[
+    waitingProcesses size ~~ 0 ifTrue:[
         needsReschedule := false.
         wasBlocked := OperatingSystem blockInterrupts.
         [
@@ -663,7 +665,7 @@
             count <= 0 ifTrue:[
                 count := count + 1.
                 count == 1 ifTrue:[
-                    waitingProcesses notNil ifTrue:[
+                    waitingProcesses size ~~ 0 ifTrue:[
                         needsReschedule := self wakeupWaiters.
                     ].
                 ].
@@ -745,7 +747,7 @@
         needsReschedule := false.
         [
             count := count + 1.
-            waitingProcesses notNil ifTrue:[
+            waitingProcesses size ~~ 0 ifTrue:[
                 needsReschedule := self wakeupWaiters.
             ].
         ] ensure:[
@@ -813,7 +815,6 @@
 
     count <= 0 ifTrue:[
         activeProcess := Processor activeProcess.
-
         "
          need a while-loop here, since more than one process may
          wait for it and another one may also wake up.
@@ -840,7 +841,8 @@
 
     count := count - 1.
     count == 0 ifTrue:[
-        lastOwner := Processor activeProcess.
+        activeProcess isNil ifTrue:[activeProcess := Processor activeProcess].
+        lastOwner := activeProcess.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
 
@@ -857,7 +859,6 @@
     count > 0 ifTrue:[
         ^ self
     ].
-
     activeProcess := Processor activeProcess.
 
     wasBlocked := OperatingSystem blockInterrupts.
@@ -983,10 +984,11 @@
         ].
     ].
 
-    "if we come here, we have accquired the semaphore"
+    "if we come here, we have acquired the semaphore"
     count := count - 1.
     count == 0 ifTrue:[
-        lastOwner := Processor activeProcess.
+        activeProcess isNil ifTrue:[activeProcess := Processor activeProcess].
+        lastOwner := activeProcess.
     ].
     wasBlocked ifFalse:[OperatingSystem unblockInterrupts].
     ^ self
@@ -998,10 +1000,10 @@
 !Semaphore class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.93 2013-07-25 09:22:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.94 2013-08-16 17:51:57 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.93 2013-07-25 09:22:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.94 2013-08-16 17:51:57 stefan Exp $'
 ! !
 
--- a/SharedPool.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/SharedPool.st	Tue Aug 20 00:07:19 2013 +0100
@@ -101,6 +101,7 @@
     "Created: / 07-02-2012 / 15:57:35 / cg"
 ! !
 
+
 !SharedPool class methodsFor:'code generation'!
 
 initializeFrom:aDictionary
@@ -132,6 +133,12 @@
 
 !SharedPool class methodsFor:'dictionary protocol'!
 
+associationsDo:aBlock
+    "enumerate all keys (= pool var names) with their value"
+
+    ^ self keys do:[:key | aBlock value:(Association key:key value:(self at:key))]
+!
+
 do:aBlock
     "enumerate all values"
 
@@ -263,9 +270,10 @@
 !SharedPool class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.21 2012-08-03 15:52:47 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.22 2013-08-16 17:43:34 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.21 2012-08-03 15:52:47 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.22 2013-08-16 17:43:34 stefan Exp $'
 ! !
+
--- a/Smalltalk.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Smalltalk.st	Tue Aug 20 00:07:19 2013 +0100
@@ -4736,26 +4736,26 @@
     table := IdentityDictionary new:100.
 
     Method allSubInstancesDo:[:aMethod |
-	source := nil.
-	aMethod sourcePosition notNil ifTrue:[
-	    aMethod sourceFilename = 'st.src' ifTrue:[
-		source := aMethod source.
-	    ]
-	] ifFalse:[
-	    source := aMethod source
-	].
-
-	source notNil ifTrue:[
-	    pos := newStream position1Based.
-	    newStream nextChunkPut:source.
-
-	    "
-	     dont change the methods info - maybe some write error
-	     occurs later, in that case we abort and leave everything
-	     untouched.
-	    "
-	    table at:aMethod put:pos
-	]
+        source := nil.
+        aMethod sourcePosition notNil ifTrue:[
+            aMethod sourceFilename = 'st.src' ifTrue:[
+                source := aMethod source.
+            ]
+        ] ifFalse:[
+            source := aMethod source
+        ].
+
+        source notNil ifTrue:[
+            pos := newStream position + 1.
+            newStream nextChunkPut:source.
+
+            "
+             dont change the methods info - maybe some write error
+             occurs later, in that case we abort and leave everything
+             untouched.
+            "
+            table at:aMethod put:pos
+        ]
     ].
 
     newStream syncData; close.
@@ -4770,7 +4770,7 @@
      source reference"
 
     table keysAndValuesDo:[:aMethod :pos |
-	aMethod localSourceFilename:fileName position:pos.
+        aMethod localSourceFilename:fileName position:pos.
 "/        aMethod printCR.
     ].
 
@@ -4798,18 +4798,18 @@
     table := IdentityDictionary new:100.
 
     Method allSubInstancesDo:[:aMethod |
-	source := aMethod source.
-	source notNil ifTrue:[
-	    pos := newStream position1Based.
-	    newStream nextChunkPut:source.
-
-	    "
-	     dont change the methods info - maybe some write error
-	     occurs later, in that case we abort and leave everything
-	     untouched.
-	    "
-	    table at:aMethod put:pos
-	]
+        source := aMethod source.
+        source notNil ifTrue:[
+            pos := newStream position + 1.
+            newStream nextChunkPut:source.
+
+            "
+             dont change the methods info - maybe some write error
+             occurs later, in that case we abort and leave everything
+             untouched.
+            "
+            table at:aMethod put:pos
+        ]
     ].
 
     newStream syncData; close.
@@ -4824,7 +4824,7 @@
      source reference"
 
     table keysAndValuesDo:[:aMethod :pos |
-	aMethod localSourceFilename:fileName position:pos.
+        aMethod localSourceFilename:fileName position:pos.
 "/        aMethod printCR.
     ].
 
@@ -8021,11 +8021,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1033 2013-08-01 15:09:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1034 2013-08-10 11:24:53 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1033 2013-08-01 15:09:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1034 2013-08-10 11:24:53 stefan Exp $'
 !
 
 version_HG
--- a/Stream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Stream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -2082,22 +2082,24 @@
 
 skipFor:anObject
     "skip all objects up-to and including anObject; 
-     return the element after anObject."
+     read and return the element after anObject."
 
     (self skipThrough:anObject) notNil ifTrue:[
-	^ self next
+        ^ self next
     ].
     ^ nil
 
     "
-     |s|
+     |s next rest|
      s := ReadStream on:#(1 2 3 4 5 6 7 8).
-     s skipFor:4.  
+     next := s skipFor:4.      
+     rest := s upToEnd.   
     "
     "
-     |s|
+     |s next rest|
      s := ReadStream on:'12345678'.
-     s skipFor:$4.  
+     next := s skipFor:$4.
+     rest := s upToEnd.
     "
 
     "Modified: 15.5.1996 / 17:59:23 / cg"
@@ -2211,6 +2213,42 @@
     "Modified: 11.1.1997 / 19:09:06 / cg"
 !
 
+skipUntil:aBlock
+    "skip all elements for which aBlock returns false. 
+     Return true if more elements can be read, false if eof has been reached."
+
+    [self atEnd] whileFalse:[
+        (aBlock value: self peek) ifTrue:[^ true].
+        self next
+    ].
+    ^ false
+
+    "
+     #(1 2 3 4 5 6 7 8 9 10) readStream
+        skipUntil:[:el | el >= 5];
+        next
+    "
+!
+
+skipWhile:aBlock
+    "skip all elements for which aBlock returns true. Return true if more elements can be read,
+     false if eof has been reached."
+
+    [self atEnd] whileFalse:[
+	(aBlock value: self peek) ifFalse:[^ true].
+	self next
+    ].
+    ^ false
+
+    "
+     #(1 2 3 4 5 6 7 8 9 10) readStream
+	skipWhile:[:el | el <= 5];
+	next
+    "
+
+    "Created: / 23-09-2011 / 13:32:40 / cg"
+!
+
 through:anObject
     "read a collection of all objects up-to anObject and return these
      elements, including anObject. 
@@ -2332,6 +2370,30 @@
     "Modified: / 11.1.1998 / 15:28:04 / cg"
 !
 
+throughElementForWhich:aBlock
+    "read elements until aBlock returns true for an element. 
+     Return the collected elements including that element.
+     Leave the stream positioned for the next read to return the element after that one."                                                             
+
+    |answerStream element|
+
+    answerStream := WriteStream on:(self contentsSpecies new).
+
+    [self atEnd] whileFalse:[
+        element := self next.
+        answerStream nextPut:element.
+        (aBlock value:element) ifTrue: [
+            ^ answerStream contents
+        ]
+    ].
+    ^ answerStream contents
+
+    "
+     #(1 2 3 4 5 6 7 8 9 10) readStream
+        throughElementForWhich:[:el | el > 5];
+    "
+!
+
 upTo:anObject
     "read a collection of all objects up-to anObject and return these
      elements, but excluding anObject. 
@@ -2518,6 +2580,30 @@
     "Modified: / 11.1.1998 / 15:19:18 / cg"
 !
 
+upToElementForWhich:aBlock
+    "read elements until aBlock returns true for an element. 
+     Return the collected elements excluding that element.
+     Leave the stream positioned for the next read to return that element."                                                             
+
+    |answerStream next|
+
+    answerStream := WriteStream on:(self contentsSpecies new).
+
+    [
+        self atEnd 
+        or:[ (aBlock value: (next := self peek)) ]
+    ] whileFalse:[
+        answerStream nextPut:next.
+        self next.
+    ].
+    ^ answerStream contents
+
+    "
+     #(1 2 3 4 5 6 7 8 9 10) readStream
+        upToElementForWhich:[:el | el > 5]
+    "
+!
+
 upToEnd
     "return a collection of the elements up-to the end.
      Return an empty collection, if the stream-end is already at the end."
@@ -3318,11 +3404,11 @@
 !Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.203 2013-08-01 10:42:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.206 2013-08-18 11:02:56 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.203 2013-08-01 10:42:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.206 2013-08-18 11:02:56 cg Exp $'
 ! !
 
 
--- a/Win32OperatingSystem.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/Win32OperatingSystem.st	Tue Aug 20 00:07:19 2013 +0100
@@ -16880,29 +16880,26 @@
     }
 
     if (__hostName) {
+        int err;
+
         do {
-# ifdef DO_WRAP_CALLS
+# if 0 && defined(DO_WRAP_CALLS)
+            /* This does not work - the structure is allocated in thread local storage */
             hp = STX_WSA_NOINT_CALL1("gethostbyname", gethostbyname, __hostName);
             if ((INT)hp < 0) hp = NULL;
 # else
             /* __BEGIN_INTERRUPTABLE__ is dangerous, because gethostbyname
-             * uses a static data area
+             * uses a static data area, but allocates it in thread local storage
              */
-            __BEGIN_INTERRUPTABLE__
+            // __BEGIN_INTERRUPTABLE__
             hp = gethostbyname(__hostName);
-            __END_INTERRUPTABLE__
-#endif
-        } while ((hp == NULL)
-                  && (
-                        (h_errno == TRY_AGAIN)
-                      || errno == EINTR
-#   ifdef IRIX5_3
-                      || (errno == ECONNREFUSED)
-#   endif
-                     )
-        );
+            // __END_INTERRUPTABLE__
+#endif
+        } while ((hp == NULL 
+                  && (err = WSAGetLastError()) == EINTR
+                      || err == TRY_AGAIN));
         if (hp == 0) {
-            switch (h_errno) {
+            switch (err) {
             case HOST_NOT_FOUND:
                 errorString = @symbol(unknownHost);
                 break;
@@ -16919,7 +16916,7 @@
                 errorString = @symbol(unknownError);
                 break;
             }
-            error = __mkSmallInteger(h_errno);
+            error = __mkSmallInteger(err);
             goto err;
         }
 
@@ -16997,6 +16994,9 @@
 %}.
     error notNil ifTrue:[
         |request|
+        error isSymbol ifTrue:[
+            self primitiveFailed:error.
+        ].
         request := SocketAddressInfo new
             domain:domainArg;
             type:typeArg;
@@ -17027,23 +17027,23 @@
      self getAddressInfo:'localhost' serviceName:nil
             domain:nil type:nil protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:nil
-            domain:#inet type:#stream protocol:nil flags:nil
+            domain:#AF_INET type:#stream protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:nil
-            domain:#inet type:#stream protocol:#tcp flags:nil
+            domain:#AF_INET type:#stream protocol:#tcp flags:nil
      self getAddressInfo:'localhost' serviceName:10
-            domain:#inet type:#stream protocol:#tcp flags:nil
+            domain:#AF_INET type:#stream protocol:#tcp flags:nil
      self getAddressInfo:'localhost' serviceName:'10'
-            domain:#inet type:#stream protocol:#tcp flags:nil
+            domain:#AF_INET type:#stream protocol:#tcp flags:nil
      self getAddressInfo:'blurb.exept.de' serviceName:nil
-            domain:#inet type:nil protocol:nil flags:nil
+            domain:#AF_INET type:nil protocol:nil flags:nil
      self getAddressInfo:'1.2.3.4' serviceName:'bla'
-            domain:#inet type:nil protocol:nil flags:nil
+            domain:#AF_INET type:nil protocol:nil flags:nil
      self getAddressInfo:'localhost' serviceName:'echo'
-            domain:#inet type:nil protocol:nil flags:nil
+            domain:#AF_INET type:nil protocol:nil flags:nil
      self getAddressInfo:nil serviceName:'echo'
-            domain:#inet type:nil protocol:nil flags:nil
+            domain:#AF_INET type:nil protocol:nil flags:nil
      self getAddressInfo:nil serviceName:nil
-            domain:#inet type:nil protocol:nil flags:nil
+            domain:#AF_INET type:nil protocol:nil flags:nil
      self getAddressInfo:'www.google.de' serviceName:nil
             domain:nil type:nil protocol:nil flags:nil
      self getAddressInfo:'smc1' serviceName:nil
@@ -17078,20 +17078,20 @@
     int nInstBytes, sockAddrSize;
 
     if (wantHostName == true) {
-	hp = host;
-	hsz = sizeof(host);
+        hp = host;
+        hsz = sizeof(host);
     }
     if (wantServiceName == true) {
-	sp = service;
-	ssz = sizeof(service);
+        sp = service;
+        ssz = sizeof(service);
     }
     if (hp == 0 && sp == 0) {
-	error = @symbol(badArgument);
-	goto err;
+        error = @symbol(badArgument);
+        goto err;
     }
     if (!__isBytes(socketAddress)) {
-	error = @symbol(badArgument1);
-	goto err;
+        error = @symbol(badArgument1);
+        goto err;
     }
 
     nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(socketAddress))->c_ninstvars));
@@ -17099,177 +17099,170 @@
     sockAddrSize -= nInstBytes;
 
     if (!__isSmallInteger(flags)) {
-	error = @symbol(badArgument5);
-	goto err;
+        error = @symbol(badArgument5);
+        goto err;
     }
     __flags = __intVal(flags);
 
 #if defined(NI_NUMERICHOST)
     if (useDatagram == true) {
-	__flags |= NI_DGRAM;
+        __flags |= NI_DGRAM;
     }
 
     {
-	extern getnameinfo();
-	bp = (char *)(__byteArrayVal(socketAddress));
-	bp += nInstBytes;
+        extern getnameinfo();
+        bp = (char *)(__byteArrayVal(socketAddress));
+        bp += nInstBytes;
 # ifdef DO_WRAP_CALLS
-	do {
-	    __threadErrno = 0;
-	    // do not cast to INT - will loose sign bit then!
-	    ret = STX_WSA_NOINT_CALL7( "getnameinfo", getnameinfo, (struct sockaddr *)bp, sockAddrSize, hp, hsz, sp, ssz, __flags);
-	} while ((ret < 0) && (__threadErrno == EINTR));
+        do {
+            __threadErrno = 0;
+            // do not cast to INT - will loose sign bit then!
+            ret = STX_WSA_NOINT_CALL7( "getnameinfo", getnameinfo, (struct sockaddr *)bp, sockAddrSize, hp, hsz, sp, ssz, __flags);
+        } while ((ret < 0) && (__threadErrno == EINTR));
 # else
-	__BEGIN_INTERRUPTABLE__
-	ret = getnameinfo((struct sockaddr *)bp, sockAddrSize,
-			  hp, hsz, sp, ssz, __flags);
-	__END_INTERRUPTABLE__
+        __BEGIN_INTERRUPTABLE__
+        ret = getnameinfo((struct sockaddr *)bp, sockAddrSize,
+                          hp, hsz, sp, ssz, __flags);
+        __END_INTERRUPTABLE__
 # endif
     } while (ret != 0 && __threadErrno == EINTR);
 
     if (ret != 0) {
-	switch (ret) {
-	    case EAI_FAMILY:
-		error = @symbol(badProtocol);
-		break;
-	    case EAI_SOCKTYPE:
-		error = @symbol(badSocketType);
-		break;
-	    case EAI_BADFLAGS:
-		error = @symbol(badFlags);
-		break;
-	    case EAI_NONAME:
-		error = @symbol(unknownHost);
-		break;
-	    case EAI_SERVICE:
-		error = @symbol(unknownService);
-		break;
-	    case EAI_MEMORY:
-		error = @symbol(allocationFailure);
-		break;
-	    case EAI_FAIL:
-		error = @symbol(permanentFailure);
-		break;
-	    case EAI_AGAIN:
-		error = @symbol(tryAgain);
-		break;
-	    default:
-		error = @symbol(unknownError);
-	}
-	errorString = __MKSTRING(gai_strerror(ret));
-	goto err;
+        switch (ret) {
+            case EAI_FAMILY:
+                error = @symbol(badProtocol);
+                break;
+            case EAI_SOCKTYPE:
+                error = @symbol(badSocketType);
+                break;
+            case EAI_BADFLAGS:
+                error = @symbol(badFlags);
+                break;
+            case EAI_NONAME:
+                error = @symbol(unknownHost);
+                break;
+            case EAI_SERVICE:
+                error = @symbol(unknownService);
+                break;
+            case EAI_MEMORY:
+                error = @symbol(allocationFailure);
+                break;
+            case EAI_FAIL:
+                error = @symbol(permanentFailure);
+                break;
+            case EAI_AGAIN:
+                error = @symbol(tryAgain);
+                break;
+            default:
+                error = @symbol(unknownError);
+        }
+        errorString = __MKSTRING(gai_strerror(ret));
+        goto err;
     }
 # else /* ! NI_NUMERICHOST */
     {
-	/*
-	 * Do it using gethostbyaddr()
-	 */
-	struct sockaddr_in *sa;
-
-	if (sockAddrSize < sizeof(*sa)) {
-	    error = @symbol(badArgument1);
-	    goto err;
-	}
-	bp = (char *)(__byteArrayVal(socketAddress));
-	bp += nInstBytes;
-	sa = (struct sockaddr_in *)bp;
-
-	if (sp) {
-	    struct servent *servp;
-	    char *__proto = 0;
-
-	    __proto = (useDatagram == true ? "udp" : "tcp");
-
-	    servp = getservbyport(sa->sin_port, __proto);
-	    if (servp) {
-		sp = servp->s_name;
-	    }
-	}
-	if (hp) {
-	    struct hostent *hostp;
-#  ifdef USE_H_ERRNO
-	    do {
-		/* must refetch in loop */
-		bp = (char *)(__byteArrayVal(socketAddress));
-		bp += nInstBytes;
-		sa = (struct sockaddr_in *)bp;
-		/* __BEGIN_INTERRUPTABLE__ is dangerous, because gethostbyname uses a static data area
-		 */
-		hostp = gethostbyaddr((char *)&sa->sin_addr, sockAddrSize, sa->sin_family);
-		/* __END_INTERRUPTABLE__ */
-	    } while ((hostp == NULL)
-		      && ((h_errno == TRY_AGAIN)
-			  || errno == EINTR
-#   ifdef IRIX5_3
-			  || (errno == ECONNREFUSED)
-#   endif
-			 )
-	    );
-	    if (hostp == 0) {
-		switch (h_errno) {
-		case HOST_NOT_FOUND:
-		    errorString = @symbol(unknownHost);
-		    break;
-		case NO_ADDRESS:
-		    errorString = @symbol(noAddress);
-		    break;
-		case NO_RECOVERY:
-		    errorString = @symbol(permanentFailure);
-		    break;
-		case TRY_AGAIN:
-		    errorString = @symbol(tryAgain);
-		    break;
-		default:
-		    errorString = @symbol(unknownError);
-		    break;
-		}
-		error = __mkSmallInteger(h_errno);
-		goto err;
-	    }
-#  else /* !USE_H_ERRNO */
-	    hostp = gethostbyaddr((char *)&sa->sin_addr, sockAddrSize, sa->sin_family);
-	    if (hostp == 0) {
-		errorString = @symbol(unknownHost);
-		error = __mkSmallInteger(-1);
-		goto err;
-	    }
-#  endif /* !USE_H_ERRNO*/
-	    hp = hostp->h_name;
-	}
+        /*
+         * Do it using gethostbyaddr()
+         */
+        struct sockaddr_in *sa;
+
+        if (sockAddrSize < sizeof(*sa)) {
+            error = @symbol(badArgument1);
+            goto err;
+        }
+        bp = (char *)(__byteArrayVal(socketAddress));
+        bp += nInstBytes;
+        sa = (struct sockaddr_in *)bp;
+
+        if (sp) {
+            struct servent *servp;
+            char *__proto = 0;
+
+            __proto = (useDatagram == true ? "udp" : "tcp");
+
+            servp = getservbyport(sa->sin_port, __proto);
+            if (servp) {
+                sp = servp->s_name;
+            }
+        }
+        if (hp) {
+            struct hostent *hostp;
+            int err;
+
+            do {
+                /* must refetch in loop */
+                bp = (char *)(__byteArrayVal(socketAddress));
+                bp += nInstBytes;
+                sa = (struct sockaddr_in *)bp;
+                /* __BEGIN_INTERRUPTABLE__ is dangerous, because gethostbyname uses a static data area
+                 */
+                hostp = gethostbyaddr((char *)&sa->sin_addr, sockAddrSize, sa->sin_family);
+                /* __END_INTERRUPTABLE__ */
+            } while ((hostp == NULL)
+                      && ((err = WSAGetLastError()) == TRY_AGAIN
+                          || err == EINTR
+                         )
+            );
+            if (hostp == 0) {
+                switch (err) {
+                case HOST_NOT_FOUND:
+                    errorString = @symbol(unknownHost);
+                    break;
+                case NO_ADDRESS:
+                    errorString = @symbol(noAddress);
+                    break;
+                case NO_RECOVERY:
+                    errorString = @symbol(permanentFailure);
+                    break;
+                case TRY_AGAIN:
+                    errorString = @symbol(tryAgain);
+                    break;
+                default:
+                    errorString = @symbol(unknownError);
+                    break;
+                }
+                error = __mkSmallInteger(err);
+                goto err;
+            }
+            hp = hostp->h_name;
+        }
     }
 # endif /* ! NI_NUMERICHOST */
 
     if (hp)
-	hostName = __MKSTRING(hp);
+        hostName = __MKSTRING(hp);
     if (sp)
-	serviceName = __MKSTRING(sp);
+        serviceName = __MKSTRING(sp);
 err:;
 #else
     error = @symbol(notImplemented);
 #endif
 %}.
     error notNil ifTrue:[
-	^ (HostAddressLookupError new
-		parameter:error;
-		messageText:' - ', errorString;
-		request:thisContext message) raiseRequest.
+        error isSymbol ifTrue:[
+            self primitiveFailed:error.
+        ].
+        ^ (HostAddressLookupError new
+                parameter:error;
+                messageText:' - ', (errorString ? error printString);
+                request:thisContext message) raiseRequest.
     ].
 
     ^ Array with:hostName with:serviceName
 
     "
      self getNameInfo:
-	(self getAddressInfo:'localhost' serviceName:'echo'
-		domain:#inet type:#stream protocol:nil flags:nil) first socketAddress
-	 wantHostName:true wantServiceName:true datagram:false flags:0
+        (self getAddressInfo:'localhost' serviceName:'echo'
+                domain:#AF_INET type:#stream protocol:nil flags:nil) first socketAddress
+         wantHostName:true wantServiceName:true datagram:false flags:0
 
      self getNameInfo:
-	(self getAddressInfo:'exept.exept.de' serviceName:'echo'
-		domain:#inet type:#stream protocol:nil flags:nil) first socketAddress
-	 wantHostName:true wantServiceName:true datagram:false flags:0
-
-     self getNameInfo:#[1 2 3 4]
-	 wantHostName:true wantServiceName:true datagram:false flags:0
+        (self getAddressInfo:'exept.exept.de' serviceName:'echo'
+                domain:#AF_INET type:#stream protocol:nil flags:nil) first socketAddress
+         wantHostName:true wantServiceName:true datagram:false flags:0
+
+     self getNameInfo:(IPSocketAddress hostAddress:#[1 2 3 4])
+         wantHostName:true wantServiceName:true datagram:false flags:0
     "
 ! !
 
@@ -17338,15 +17331,15 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.477 2013-08-02 15:31:19 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.478 2013-08-09 14:30:12 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.477 2013-08-02 15:31:19 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.478 2013-08-09 14:30:12 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Win32OperatingSystem.st,v 1.477 2013-08-02 15:31:19 stefan Exp $'
+    ^ '$Id: Win32OperatingSystem.st,v 1.478 2013-08-09 14:30:12 cg Exp $'
 
 ! !
 
--- a/WriteStream.st	Mon Aug 19 23:30:27 2013 +0100
+++ b/WriteStream.st	Tue Aug 20 00:07:19 2013 +0100
@@ -196,7 +196,7 @@
 
 !WriteStream methodsFor:'positioning'!
 
-position0Based:index0Based
+position:index0Based
     "redefined to allow positioning past the readLimit"
 
     ((index0Based > collection size) or:[index0Based < 0]) ifTrue: [^ self positionError].
@@ -295,7 +295,7 @@
 isEmpty
     "return true, if the contents of the stream is empty"
 
-    ^ self position0Based == 0
+    ^ self position == 0
 
     "Created: 14.10.1997 / 20:44:37 / cg"
 ! !
@@ -649,10 +649,10 @@
 !WriteStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.79 2013-07-06 13:30:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.80 2013-08-10 11:30:31 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.79 2013-07-06 13:30:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/WriteStream.st,v 1.80 2013-08-10 11:30:31 stefan Exp $'
 ! !