Merged with trunk jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 13 Apr 2012 14:18:13 +0100
branchjv
changeset 17938 e2aad1d7c317
parent 17937 cf90cbd4e3f3
child 17939 9ea58e0aad5a
Merged with trunk
CharacterEncoder.st
ClassDescription.st
Collection.st
CompiledCode.st
EncodedStream.st
ExternalBytes.st
ExternalStream.st
FileStream.st
Filename.st
GenericException.st
Integer.st
Method.st
NameSpace.st
Object.st
ObjectMemory.st
OrderedCollection.st
SequenceableCollection.st
SmalltalkLanguage.st
SortedCollection.st
Stream.st
String.st
Unicode16String.st
UninterpretedBytes.st
WeakArray.st
Win32OperatingSystem.st
libbasic.vcproj
--- a/CharacterEncoder.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/CharacterEncoder.st	Fri Apr 13 14:18:13 2012 +0100
@@ -1100,15 +1100,13 @@
      (which is usually the first few bytes of a textFile).
      If thats not found, use heuristics (in CharacterArray) to guess."
 
-    |s buffer n "{Class: SmallInteger }"
-     binary enc|
+    |s buffer n "{Class: SmallInteger }" enc|
 
     s := aFilename asFilename readStreamOrNil.
     s isNil ifTrue:[^ nil].
 
     buffer := String new:64.
-    n := buffer size.
-    n := s nextBytes:n into:buffer.
+    n := s nextBytes:buffer size into:buffer.
     s close.
 
     enc := self guessEncodingOfBuffer:buffer.
@@ -1147,8 +1145,9 @@
     ^ nil
 
     "
-     self guessEncodingOfFile:'../../libview2/resources/ApplicationModel_de.rs' asFilename
-     self guessEncodingOfFile:'../../libview2/resources/ApplicationModel_ru.rs' asFilename
+     self guessEncodingOfFile:'../../libview/resources/de.rs' asFilename
+     self guessEncodingOfFile:'../../libview/resources/ru.rs' asFilename
+     self guessEncodingOfFile:'../../libview/resources/th.rs' asFilename
     "
 
     "Modified: / 31-05-2011 / 15:45:19 / cg"
@@ -1166,8 +1165,7 @@
     buffer := String new:64.
 
     oldPosition := aStream position.
-    n := buffer size.
-    n := aStream nextBytes:n into:buffer.
+    n := aStream nextBytes:buffer size into:buffer.
     aStream position:oldPosition.
 
     ^ self guessEncodingOfBuffer:buffer
@@ -1627,15 +1625,15 @@
 !CharacterEncoder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.111 2011/05/31 14:06:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.112 2012/04/05 10:00:23 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.111 2011/05/31 14:06:40 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.112 2012/04/05 10:00:23 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoder.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoder.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 CharacterEncoder initialize!
--- a/ClassDescription.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/ClassDescription.st	Fri Apr 13 14:18:13 2012 +0100
@@ -820,7 +820,6 @@
     "Created: / 28.3.1998 / 21:21:52 / cg"
 ! !
 
-
 !ClassDescription methodsFor:'Compatibility-V''Age'!
 
 categoriesFor:aSelector are:listOfCategories
@@ -1492,24 +1491,23 @@
         streamType := FileStream.
     ].
 
-    "/ changeFileIsNew := fileName asFilename exists not or:[fileName asFilename fileSize = 0].
-    changeFileIsNew := (fileName asFilename fileSize ? 0) = 0.
-    changeFileIsNew ifTrue:[
-        encoder := CharacterEncoder encoderForUTF8.
-    ] ifFalse:[
-        encoding := CharacterEncoder guessEncodingOfFile:fileName.
-        encoding isNil ifTrue:[
-            encoding := #'iso8859-1'.
-        ].
-        encoder := CharacterEncoder encoderFor:encoding.
-    ].
-
     [
         changesStream := streamType fileNamed:fileName.
     ] on:FileStream openErrorSignal do:[:ex|
         self warn:'cannot create/update the changes file (check permissions)'.
         ^ nil
     ].
+
+    changeFileIsNew := changesStream fileSize = 0.
+    changeFileIsNew ifTrue:[
+        encoder := CharacterEncoder encoderForUTF8.
+    ] ifFalse:[
+        encoding := CharacterEncoder guessEncodingOfStream:changesStream.
+        encoding isNil ifTrue:[
+            encoding := #'iso8859-1'.
+        ].
+        encoder := CharacterEncoder encoderFor:encoding.
+    ].
     changesStream setToEnd.
 
     changesStream := EncodedStream stream:changesStream encoder:encoder.
@@ -2474,6 +2472,10 @@
     XMLCoder putQuotedString:someString on:aStream
 ! !
 
+!ClassDescription methodsFor:'misc'!
+
+ !
+
 !ClassDescription methodsFor:'printOut'!
 
 nameWithNameSpacePrefix
@@ -4190,21 +4192,17 @@
 !ClassDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.222 2012/01/31 12:58:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.223 2012/04/05 10:12:26 stefan Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.222 2012/01/31 12:58:01 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.223 2012/04/05 10:12:26 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ClassDescription.st 10777 2012-02-13 19:19:41Z vranyj1 $'
+    ^ '$Id: ClassDescription.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
-ClassDescription initialize!
 ClassDescription::MethodRedefinitionNotification initialize!
+ClassDescription initialize!
 ClassDescription::ClassRedefinitionNotification initialize!
-
-
-
-
--- a/Collection.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Collection.st	Fri Apr 13 14:18:13 2012 +0100
@@ -355,6 +355,8 @@
 !Collection methodsFor:'Compatibility-Squeak'!
 
 , aCollection
+    "return a new collection formed from concatenating the receiver with the argument"
+
     ^ self copy addAll: aCollection; yourself
 
     "Created: / 14-09-2011 / 16:32:06 / cg"
@@ -4325,15 +4327,15 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.274 2012/03/18 14:17:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.275 2012/04/01 11:22:59 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Collection.st,v 1.274 2012/03/18 14:17:38 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Collection.st,v 1.275 2012/04/01 11:22:59 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: Collection.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: Collection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Collection initialize!
--- a/CompiledCode.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/CompiledCode.st	Fri Apr 13 14:18:13 2012 +0100
@@ -37,7 +37,7 @@
 documentation
 "
     This is an abstract class, to merge common attributes of Blocks and
-    Methods i.e. describe all objects consisting of either compiled or 
+    Methods i.e. describe all objects consisting of either compiled or
     interpreted code.
 
     Instances of CompiledCode are not to be created by user code
@@ -57,7 +57,7 @@
     [Class variables:]
 
       NoByteCodeSignal              raised if a codeObject is about to be executed
-                                    which has neither code nor byteCode (i.e. both are nil)
+				    which has neither code nor byteCode (i.e. both are nil)
       InvalidByteCodeSignal         raised if byteCode is not an instance of ByteArray
       InvalidInstructionSignal      raised if an invalid instruction opcode is encountered
       BadLiteralsSignal             raised if literalArray is not an array
@@ -69,7 +69,7 @@
     NOTICE: layout known by runtime system and compiler - do not change
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 "
 ! !
 
@@ -88,16 +88,16 @@
 new:numberOfLiterals
     "create a new method with numberOfLiterals.
      Implementation note:
-        If (self size) == 1, the only literal is an indirect literal
-        containing an array of literals. Otherwise the literals
-        are stored in self.
+	If (self size) == 1, the only literal is an indirect literal
+	containing an array of literals. Otherwise the literals
+	are stored in self.
     "
 
     |nlits|
 
     nlits := numberOfLiterals.
     nlits <= 1 ifTrue:[
-        nlits := nlits + 1.
+	nlits := nlits + 1.
     ].
     ^ self basicNew:nlits.
 
@@ -126,7 +126,7 @@
 
 maxNumberOfArguments
     "return the maximum number of arguments a method can have.
-     This is a limit in the VM, which may be removed in one of 
+     This is a limit in the VM, which may be removed in one of
      the next versions ..."
 
 %{  /* NOCONTEXT */
@@ -200,7 +200,7 @@
     "return the code objects source code.
      If none is available, return the result from evaluating aBlock."
 
-    |src| 
+    |src|
 
     Screen current shiftDown ifTrue:[^ aBlock value].
     src := self source.
@@ -271,17 +271,17 @@
     |lits nLits "{ Class: SmallInteger }" |
 
     self size == 1 ifTrue:[
-        lits := self at:1.
+	lits := self at:1.
     ] ifFalse:[
-        lits := self.
+	lits := self.
     ].
 
     nLits := lits size.
     1 to:nLits do:[:i|
-        (lits at:i) == aLiteral ifTrue:[
-            lits at:i put:newLiteral.
-            ^ true.
-        ].
+	(lits at:i) == aLiteral ifTrue:[
+	    lits at:i put:newLiteral.
+	    ^ true.
+	].
     ].
     ^ false.
 
@@ -340,49 +340,49 @@
 
     numLits := self size.
     numLits == 0 ifTrue:[
-        ^ exceptionalValue value
+	^ exceptionalValue value
     ].
     numLits == 1 ifTrue:[
-        lits := self at:1.
-        lits isArray ifFalse:[
-            index == 1 ifTrue:[^ lits].
-            ^ exceptionalValue value
-        ].
-        ^ lits at:index.    
+	lits := self at:1.
+	lits isArray ifFalse:[
+	    index == 1 ifTrue:[^ lits].
+	    ^ exceptionalValue value
+	].
+	^ lits at:index.
     ].
 
     "there may be a dummy (nil) literal to make the size > 1"
     (self at:2) isNil ifTrue:[
-        index == 1 ifTrue:[^ self at:1].
-        ^ exceptionalValue value
+	index == 1 ifTrue:[^ self at:1].
+	^ exceptionalValue value
     ].
 
     ^ self at:index
 !
 
 literalAt:index put:newValue
-    "change a literal slots value. 
+    "change a literal slots value.
      WARNING: dangerous internal interface; only for knowledgable users"
 
     |lits numLits "{ Class: SmallInteger }"|
 
     numLits := self size.
     numLits == 0 ifTrue:[
-        self error:'bad literal index'
+	self error:'bad literal index'
     ].
     numLits == 1 ifTrue:[
-        lits := self at:1.
-        lits isArray ifFalse:[
-            index == 1 ifTrue:[^ self at:1 put:newValue.].
-            self error:'bad literal index'
-        ].
-        ^ lits at:index put:newValue.    
+	lits := self at:1.
+	lits isArray ifFalse:[
+	    index == 1 ifTrue:[^ self at:1 put:newValue.].
+	    self error:'bad literal index'
+	].
+	^ lits at:index put:newValue.
     ].
 
     "there may be a dummy (nil) literal to make the size > 1"
     (self at:2) isNil ifTrue:[
-        index == 1 ifTrue:[^ self at:1 put:newValue].
-        self error:'bad literal index'.
+	index == 1 ifTrue:[^ self at:1 put:newValue].
+	self error:'bad literal index'.
     ].
 
     ^ self at:index put:newValue
@@ -397,24 +397,24 @@
 
     numLits := self size.
     numLits == 0 ifTrue:[
-        ^ #()
+	^ #()
     ].
     numLits == 1 ifTrue:[
-        lits := self at:1.
-        lits isArray ifFalse:[
-            ^ Array with:lits.
-        ].
-        ^ lits.    
+	lits := self at:1.
+	lits isArray ifFalse:[
+	    ^ Array with:lits.
+	].
+	^ lits.
     ].
 
     "there may be a dummy (nil) literal to make the size > 1"
     (self at:2) isNil ifTrue:[
-        numLits := 1.
+	numLits := 1.
     ].
 
     lits := Array new:numLits.
     1 to:numLits do:[:i|
-        lits at:i put:(self at:i).
+	lits at:i put:(self at:i).
     ].
     ^ lits.
 
@@ -433,9 +433,9 @@
      none satisfied the block"
 
     self literalsDo:[:eachLiteral |
-        (aBlock value:eachLiteral) ifTrue:[
-            ^ eachLiteral
-        ]
+	(aBlock value:eachLiteral) ifTrue:[
+	    ^ eachLiteral
+	]
     ].
     ^ exceptionBlock value.
 
@@ -451,26 +451,26 @@
 
     numLits := self size.
     numLits == 0 ifTrue:[
-        ^ self
+	^ self
     ].
     numLits == 1 ifTrue:[
-        lits := self at:1.
-        numLits := lits size.
+	lits := self at:1.
+	numLits := lits size.
 
-        lits isArray ifFalse:[
-            lits := self.
-            numLits := 1.
-        ]
+	lits isArray ifFalse:[
+	    lits := self.
+	    numLits := 1.
+	]
     ] ifFalse:[
-        lits := self.
-        "there may be a dummy (nil) literal to make the size > 1"
-        (self at:2) isNil ifTrue:[
-            numLits := 1.
-        ].
+	lits := self.
+	"there may be a dummy (nil) literal to make the size > 1"
+	(self at:2) isNil ifTrue:[
+	    numLits := 1.
+	].
     ].
 
     1 to:numLits do:[:i |
-        aBlock value:(lits at:i).
+	aBlock value:(lits at:i).
     ].
 
     "Created: / 24.6.1996 / 14:17:12 / stefan"
@@ -495,19 +495,19 @@
 
     numLits := self size.
     numLits == 1 ifTrue:[
-        lits := self at:1.
-        numLits := lits size.
+	lits := self at:1.
+	numLits := lits size.
 
-        lits isArray ifFalse:[
-            lits := self.
-            numLits := 1.
-        ]
+	lits isArray ifFalse:[
+	    lits := self.
+	    numLits := 1.
+	]
     ] ifFalse:[
-        lits := self.
-        "there may be a dummy (nil) literal to make the size > 1"
-        (self at:2) isNil ifTrue:[
-            numLits := 1.
-        ].
+	lits := self.
+	"there may be a dummy (nil) literal to make the size > 1"
+	(self at:2) isNil ifTrue:[
+	    numLits := 1.
+	].
     ].
     ^ numLits
 
@@ -516,7 +516,7 @@
 
 numberOfMethodArgs
     "return the number of arguments, the method expects.
-     This method is left for backward compatibility - use #numArgs." 
+     This method is left for backward compatibility - use #numArgs."
 
     "/ self obsoleteMethodWarning:'use numArgs'.
     ^ self numArgs
@@ -526,8 +526,8 @@
 !
 
 numberOfMethodVars
-    "return the number of method local variables. 
-     This method is left for backward compatibility - use #numVars." 
+    "return the number of method local variables.
+     This method is left for backward compatibility - use #numVars."
 
     "/ self obsoleteMethodWarning:'use numVars'.
     ^ self numVars
@@ -796,12 +796,12 @@
 badArgumentArray:argsGiven
     "{ Pragma: +optSpace }"
 
-    "this error is triggered, if a non-array is passed to 
+    "this error is triggered, if a non-array is passed to
      #valueWithReceiver:.. type of methods"
 
     ^ ArgumentError
-        raiseRequestWith:self
-        errorString:' - argumentArray is not an Array'
+	raiseRequestWith:self
+	errorString:' - argumentArray is not an Array'
 
     "Modified: 4.11.1996 / 22:46:52 / cg"
 !
@@ -881,17 +881,17 @@
     "this error is triggered when the interpreter tries to execute a
      code object, where both the code and byteCode instances are nil.
      This can happen if:
-        - the Compiler/runtime system is broken, (should not happen)
+	- the Compiler/runtime system is broken, (should not happen)
 
-        - someone played around with a block/method, (you should not do this)
+	- someone played around with a block/method, (you should not do this)
 
-        - compilation of a lazy method failed
-          (i.e. the lazy method contains an error or
-           it contains primitive code and there is no stc compiler available)
+	- compilation of a lazy method failed
+	  (i.e. the lazy method contains an error or
+	   it contains primitive code and there is no stc compiler available)
 
-        - an unloaded object modules method is called for.
+	- an unloaded object modules method is called for.
 
-     Only the first case is to be considered serious 
+     Only the first case is to be considered serious
      - it should not happen if the system is used correctly."
 
     ^ NoByteCodeError raiseRequest.
@@ -916,14 +916,14 @@
     "{ Pragma: +optSpace }"
 
     "this error is triggered, when a method/block tries to perform a send with
-     more arguments than supported by the interpreter. 
-     This can only happen, if the compiler has been changed without 
+     more arguments than supported by the interpreter.
+     This can only happen, if the compiler has been changed without
      updating the VM, since the compiler checks for allowed number of
      arguments."
 
     ^ ArgumentError
-        raiseRequestWith:self
-        errorString:' - too many args in send'
+	raiseRequestWith:self
+	errorString:' - too many args in send'
 
     "Modified: 4.11.1996 / 22:47:14 / cg"
 !
@@ -932,16 +932,16 @@
     "{ Pragma: +optSpace }"
 
     "this error is triggered by the VM, if a method is called with a wrong number
-     of arguments. 
+     of arguments.
      This only applies to #valueWithReceiverXXX and #perform:withArguments: - sends.
      With a normal send, this error cannot happen."
 
     ^ WrongNumberOfArgumentsError
-        raiseRequestWith:self
-        errorString:(' - %1 got %2 arg(s) where %3 expected'
-                        bindWith:self class name
-                        with:numArgsGiven
-                        with:self numArgs)
+	raiseRequestWith:self
+	errorString:(' - %1 got %2 arg(s) where %3 expected'
+			bindWith:self class name
+			with:numArgsGiven
+			with:self numArgs)
 
     "
      2 perform:#+
@@ -957,23 +957,23 @@
      Perform the receiver-method on anObject as receiver and argArray as
      arguments. This does NO message lookup at all and mimics a
      traditional function call.
-     This method is provided for debugging- and breakpoint-support 
+     This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
-     experimental MI implementations - it is not for general use. 
+     experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its 
+     The receiver must be a method compiled in anObjects class or one of its
      superclasses and also, the number of arguments given must match the methods
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
-    ^ self 
-        valueWithReceiver:anObject 
-        arguments:argArray 
-        selector:nil 
-        search:nil
-        sender:nil
+    ^ self
+	valueWithReceiver:anObject
+	arguments:argArray
+	selector:nil
+	search:nil
+	sender:nil
 
     "Modified: 4.4.1997 / 23:33:56 / cg"
     "Created: 30.7.1997 / 12:04:52 / cg"
@@ -984,23 +984,23 @@
      Perform the receiver-method on anObject as receiver and argArray as
      arguments. This does NO message lookup at all and mimics a
      traditional function call.
-     This method is provided for debugging- and breakpoint-support 
+     This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
-     experimental MI implementations - it is not for general use. 
+     experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its 
+     The receiver must be a method compiled in anObjects class or one of its
      superclasses and also, the number of arguments given must match the methods
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
-    ^ self 
-        valueWithReceiver:anObject 
-        arguments:argArray 
-        selector:aSymbol 
-        search:nil
-        sender:nil
+    ^ self
+	valueWithReceiver:anObject
+	arguments:argArray
+	selector:aSymbol
+	search:nil
+	sender:nil
 
     "Modified: 4.4.1997 / 23:34:08 / cg"
     "Created: 30.7.1997 / 12:04:49 / cg"
@@ -1011,23 +1011,23 @@
      Perform the receiver-method on anObject as receiver and argArray as
      arguments. This does NO message lookup at all and mimics a
      traditional function call.
-     This method is provided for debugging- and breakpoint-support 
+     This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
-     experimental MI implementations - it is not for general use. 
+     experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its 
+     The receiver must be a method compiled in anObjects class or one of its
      superclasses and also, the number of arguments given must match the methods
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
      The system is NOT always detecting a wrong method/receiver combination.
      YOU HAVE BEEN WARNED."
 
-    ^ self 
-        valueWithReceiver:anObject 
-        arguments:argArray 
-        selector:aSymbol 
-        search:nil
-        sender:nil
+    ^ self
+	valueWithReceiver:anObject
+	arguments:argArray
+	selector:aSymbol
+	search:nil
+	sender:nil
 
     "Modified: 4.4.1997 / 23:34:19 / cg"
     "Created: 30.7.1997 / 12:04:46 / cg"
@@ -1038,11 +1038,11 @@
      Perform the receiver-method on anObject as receiver and argArray as
      arguments. This does NO message lookup at all and mimics a
      traditional function call.
-     This method is provided for debugging- and breakpoint-support 
+     This method is provided for debugging- and breakpoint-support
      (replacing a method by a stub and recalling the original), or to implement
-     experimental MI implementations - it is not for general use. 
+     experimental MI implementations - it is not for general use.
 
-     The receiver must be a method compiled in anObjects class or one of its 
+     The receiver must be a method compiled in anObjects class or one of its
      superclasses and also, the number of arguments given must match the methods
      expectations -
      - otherwise strange things (and also strange crashes) can occur.
@@ -1060,286 +1060,286 @@
      * args must be an array, or nil
      */
     if (__isArray(argArray)) {
-        nargs = __arraySize(argArray);
-        ap = __ArrayInstPtr(argArray)->a_element;
+	nargs = __arraySize(argArray);
+	ap = __ArrayInstPtr(argArray)->a_element;
     } else {
-        if (argArray != nil) {
-            goto badArgs;
-        }
-        nargs = 0;
-        ap = (OBJ *)0;
+	if (argArray != nil) {
+	    goto badArgs;
+	}
+	nargs = 0;
+	ap = (OBJ *)0;
     }
 
 #ifdef F_NARGS
-    if (((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT) == nargs) 
+    if (((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT) == nargs)
 #endif
     {
-        code = __MethodInstPtr(self)->m_code;
-        if (aClass == nil) {
-            searchClass = dummy.ilc_class = __Class(anObject);
-        } else {
-            searchClass = dummy.ilc_class = aClass;
-        }
+	code = __MethodInstPtr(self)->m_code;
+	if (aClass == nil) {
+	    searchClass = dummy.ilc_class = __Class(anObject);
+	} else {
+	    searchClass = dummy.ilc_class = aClass;
+	}
 
-        if (nargs <= 15) {
-          OBJ rslt;
+	if (nargs <= 15) {
+	  OBJ rslt;
 #ifdef CONTEXT_DEBUG
-          OBJ sav = __thisContext;
+	  OBJ sav = __thisContext;
 #endif
 
-          /*
-           * add virtual sender (unwinding) here later,
-           * to allow hiding contexts in lazy methods.
-           * (this is cosmetics only; therefore its done later)
-           */
-          if (code) {
-            /* compiled code */
-            switch (nargs) {
-                case 0:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
-                    break;
+	  /*
+	   * add virtual sender (unwinding) here later,
+	   * to allow hiding contexts in lazy methods.
+	   * (this is cosmetics only; therefore its done later)
+	   */
+	  if (code) {
+	    /* compiled code */
+	    switch (nargs) {
+		case 0:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
+		    break;
 
-                case 1:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
-                    break;
+		case 1:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
+		    break;
 
-                case 2:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
-                    break;
+		case 2:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
+		    break;
 
-                case 3:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
-                    break;
+		case 3:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
+		    break;
 
-                case 4:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3]);
-                    break;
+		case 4:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3]);
+		    break;
 
-                case 5:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4]);
-                    break;
+		case 5:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4]);
+		    break;
 
-                case 6:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
-                    break;
+		case 6:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
+		    break;
 
-                case 7:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
-                    break;
+		case 7:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
+		    break;
 
-                case 8:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
-                    break;
+		case 8:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
+		    break;
 
-                case 9:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
-                    break;
+		case 9:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
+		    break;
 
-                case 10:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9]);
-                    break;
+		case 10:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9]);
+		    break;
 
-                case 11:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9], ap[10]);
-                    break;
+		case 11:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9], ap[10]);
+		    break;
 
-                case 12:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9], ap[10], ap[11]);
-                    break;
+		case 12:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9], ap[10], ap[11]);
+		    break;
 
-                case 13:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9], ap[10], ap[11], ap[12]);
-                    break;
+		case 13:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9], ap[10], ap[11], ap[12]);
+		    break;
 
-                case 14:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9], ap[10], ap[11], ap[12], ap[13]);
-                    break;
+		case 14:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9], ap[10], ap[11], ap[12], ap[13]);
+		    break;
 
-                case 15:
-                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
-                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
-                                 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
-                    break;
-            }
-          } else {
-            /* interpreted code */
+		case 15:
+		    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
+				 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
+				 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
+		    break;
+	    }
+	  } else {
+	    /* interpreted code */
 #ifdef PASS_ARG_POINTER
-            rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
+	    rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
 #else
-            switch (nargs) {
-                case 0:
-                    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
-                    break;
+	    switch (nargs) {
+		case 0:
+		    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
+		    break;
 
-                case 1:
-                    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0]);
-                    break;
+		case 1:
+		    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
+				   ap[0]);
+		    break;
 
-                case 2:
-                    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1]);
-                    break;
+		case 2:
+		    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1]);
+		    break;
 
-                case 3:
-                    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2]);
-                    break;
+		case 3:
+		    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2]);
+		    break;
 
-                case 4:
-                    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3]);
-                    break;
+		case 4:
+		    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3]);
+		    break;
 
-                case 5:
-                    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4]);
-                    break;
+		case 5:
+		    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4]);
+		    break;
 
-                case 6:
-                    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
-                    break;
+		case 6:
+		    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
+		    break;
 
-                case 7:
-                    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
-                    break;
+		case 7:
+		    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
+		    break;
 
-                case 8:
-                    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7]);
-                    break;
+		case 8:
+		    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7]);
+		    break;
 
-                case 9:
-                    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8]);
-                    break;
+		case 9:
+		    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8]);
+		    break;
 
-                case 10:
-                    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9]);
-                    break;
+		case 10:
+		    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9]);
+		    break;
 
-                case 11:
-                    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9], ap[10]);
-                    break;
+		case 11:
+		    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9], ap[10]);
+		    break;
 
-                case 12:
-                    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9], ap[10], ap[11]);
-                    break;
+		case 12:
+		    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9], ap[10], ap[11]);
+		    break;
 
-                case 13:
-                    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12]);
-                    break;
+		case 13:
+		    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12]);
+		    break;
 
-                case 14:
-                    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13]);
-                    break;
+		case 14:
+		    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13]);
+		    break;
 
-                case 15:
-                    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
-                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
-                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
-                    break;
-            }
+		case 15:
+		    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
+				   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
+				   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
+		    break;
+	    }
 #endif
-          }
+	  }
 #ifdef CONTEXT_DEBUG
-          if (sav != __thisContext) {
-              if (code) {
-                  printf("CONTEXT BOTCH after execution of %x\n", code);
-              } else {
-                  printf("CONTEXT BOTCH after execution of interpreted method\n");
-                  printf("code now: %x\n", __MethodInstPtr(self)->m_code);
-              }
-              printf("context before:\n");
-              __dumpObject__(sav);
-              printf("context now:\n");
-              __dumpObject__(__thisContext);
-          }
+	  if (sav != __thisContext) {
+	      if (code) {
+		  printf("CONTEXT BOTCH after execution of %x\n", code);
+	      } else {
+		  printf("CONTEXT BOTCH after execution of interpreted method\n");
+		  printf("code now: %x\n", __MethodInstPtr(self)->m_code);
+	      }
+	      printf("context before:\n");
+	      __dumpObject__(sav, __LINE__);
+	      printf("context now:\n");
+	      __dumpObject__(__thisContext, __LINE__);
+	  }
 #endif
-          RETURN (rslt);
-        }
+	  RETURN (rslt);
+	}
     }
     badArgs: ;
 %}.
     (argArray isMemberOf:Array) ifFalse:[
-        (self numArgs ~~ 0
-        or:[argArray notNil]) ifTrue:[
-            "
-             arguments must be either nil or an array
-            "
-            ^ self badArgumentArray:argArray
-        ]
+	(self numArgs ~~ 0
+	or:[argArray notNil]) ifTrue:[
+	    "
+	     arguments must be either nil or an array
+	    "
+	    ^ self badArgumentArray:argArray
+	]
     ].
 
     (argArray size ~~ self numArgs) ifTrue:[
-        "
-         the method expects a different number of arguments
-        "
-        ^ self wrongNumberOfArguments:argArray size
+	"
+	 the method expects a different number of arguments
+	"
+	^ self wrongNumberOfArguments:argArray size
     ].
-    
+
     "/ the VM only supports a limited number of arguments in sends
     "/ (currently, 15)
     argArray size > self class maxNumberOfArguments ifTrue:[
-        ^ self tooManyArguments
+	^ self tooManyArguments
     ].
     ^ self primitiveFailed
 
     "
-     (Float compiledMethodAt:#+) 
-        valueWithReceiver:1.0 arguments:#(2.0)
+     (Float compiledMethodAt:#+)
+	valueWithReceiver:1.0 arguments:#(2.0)
 
      'the next example is a wrong one - which is detected by True's method ...'.
-     (True compiledMethodAt:#printString) 
-        valueWithReceiver:false arguments:nil
+     (True compiledMethodAt:#printString)
+	valueWithReceiver:false arguments:nil
 
      'the next example is a wrong one - it is nowhere detected
       and a wrong value returned ...'.
-     (Point compiledMethodAt:#x) 
-        valueWithReceiver:(1->2) arguments:nil
+     (Point compiledMethodAt:#x)
+	valueWithReceiver:(1->2) arguments:nil
 
      'the next example is VERY bad one - it is nowhere detected
       and may crash the system WARNING: save your work before doing this ...'.
-     (Point compiledMethodAt:#x) 
-        valueWithReceiver:(Object new) arguments:nil
+     (Point compiledMethodAt:#x)
+	valueWithReceiver:(Object new) arguments:nil
 
      'the next example is a wrong one - which is detected here ...'.
      (Object compiledMethodAt:#printOn:)
-        valueWithReceiver:false arguments:nil
+	valueWithReceiver:false arguments:nil
 
      'the next example is a wrong one - which is detected here ...'.
      (Object compiledMethodAt:#printOn:)
-        valueWithReceiver:false arguments:#() 
+	valueWithReceiver:false arguments:#()
     "
 
     "Modified: / 07-10-2011 / 13:58:21 / cg"
@@ -1365,9 +1365,9 @@
 
     /* made this a primitive to get define in stc.h */
     if (aBoolean == true)
-        newFlags |= F_CHECKED;
+	newFlags |= F_CHECKED;
     else
-        newFlags &= ~F_CHECKED;
+	newFlags &= ~F_CHECKED;
 
     __INST(flags) = __mkSmallInteger(newFlags);
 %}
@@ -1384,23 +1384,23 @@
     "Modified: / 20.7.1998 / 14:22:35 / cg"
 !
 
-literals:aLiteralArray 
+literals:aLiteralArray
     "set the literal array for evaluation - DANGER ALERT"
 
     |i|
 
     aLiteralArray isNil ifTrue:[
-        ^ self.
+	^ self.
     ].
 
     self size == 1 ifTrue:[
-        self at:1 put:(aLiteralArray asArray).
+	self at:1 put:(aLiteralArray asArray).
     ] ifFalse:[
-        i := 1.
-        aLiteralArray do:[:literal|
-            self at:i put:literal.
-            i := i + 1.
-        ].
+	i := 1.
+	aLiteralArray do:[:literal|
+	    self at:i put:literal.
+	    i := i + 1.
+	].
     ].
 
     "Modified: / 25.6.1996 / 22:13:08 / stefan"
@@ -1444,9 +1444,9 @@
 %{  /* NOCONTEXT */
     /* made this a primitive to get define in stc.h */
     if (aBoolean == true) {
-        __INST(flags) = (OBJ)( (INT)__INST(flags) | __MASKSMALLINT(F_RETURNABLE));
+	__INST(flags) = (OBJ)( (INT)__INST(flags) | __MASKSMALLINT(F_RETURNABLE));
     } else {
-        __INST(flags) = (OBJ)( (INT)__INST(flags) & ~__MASKSMALLINT(F_RETURNABLE));
+	__INST(flags) = (OBJ)( (INT)__INST(flags) & ~__MASKSMALLINT(F_RETURNABLE));
     }
 %}
 
@@ -1455,8 +1455,8 @@
 flags:newFlags
     "set the flags (number of method variables, stacksize).
      WARNING: for internal use by the compiler only.
-              playing around here with incorrect values 
-              may crash smalltalk badly.
+	      playing around here with incorrect values
+	      may crash smalltalk badly.
 
      Dont depend on the values in the flag field - its interpretations
      may change without notice."
@@ -1464,7 +1464,7 @@
     "/ protect myself a bit - putting in an object would crash me ...
 
     (newFlags isMemberOf:SmallInteger) ifTrue:[
-        flags := newFlags
+	flags := newFlags
     ]
 
     "Modified: 8.3.1996 / 13:26:05 / cg"
@@ -1482,9 +1482,9 @@
 
     /* made this a primitive to get define in stc.h */
     if (aBoolean == true)
-        newFlags |= F_MARKBIT;
+	newFlags |= F_MARKBIT;
     else
-        newFlags &= ~F_MARKBIT;
+	newFlags &= ~F_MARKBIT;
 
     __INST(flags) = __mkSmallInteger(newFlags);
 %}
@@ -1494,19 +1494,19 @@
 
 numberOfArgs:aNumber
     "set the number of arguments, the codeObject expects.
-     WARNING: for internal use by the compiler only.     
-              playing around here with incorrect values 
-              may (will ?)  crash smalltalk badly.
+     WARNING: for internal use by the compiler only.
+	      playing around here with incorrect values
+	      may (will ?)  crash smalltalk badly.
 
      The limitation in the max. number of arguments is due to the
-     missing SENDxx functions in the VM and cases in #perform. This too 
+     missing SENDxx functions in the VM and cases in #perform. This too
      will be removed in a later release, allowing any number of arguments."
 
     (aNumber between:0 and:self class maxNumberOfArguments) ifFalse:[
-        self error:('ST/X only supports up to a maximum of ' ,
-                    self class maxNumberOfArguments printString ,
-                    ' method arguments').
-        ^ self
+	self error:('ST/X only supports up to a maximum of ' ,
+		    self class maxNumberOfArguments printString ,
+		    ' method arguments').
+	^ self
     ].
 %{
     /* made this a primitive to get define in stc.h */
@@ -1520,17 +1520,17 @@
 
 numberOfVars:aNumber
     "set the number of local variables - for use by compiler only.
-     WARNING: for internal use by the compiler only.     
-              playing around here with incorrect values 
-              may (will ?)  crash smalltalk badly."
+     WARNING: for internal use by the compiler only.
+	      playing around here with incorrect values
+	      may (will ?)  crash smalltalk badly."
 
 %{  /* NOCONTEXT */
     INT f = __intVal(__INST(flags));
 
     /* made this a primitive to get define in stc.h */
     if (__isSmallInteger(aNumber)) {
-        f = (f & ~F_NVARS) | (__intVal(aNumber) << F_NVARSHIFT);
-        __INST(flags) = __mkSmallInteger(f);
+	f = (f & ~F_NVARS) | (__intVal(aNumber) << F_NVARSHIFT);
+	__INST(flags) = __mkSmallInteger(f);
     }
 %}
 
@@ -1541,7 +1541,7 @@
     "return thedepth of the local stack in the context.
 
      WARNING: for internal use by ST/X debuggers only.
-              This method may be removed without notice."
+	      This method may be removed without notice."
 
 %{  /* NOCONTEXT */
     INT n = (__intVal(__INST(flags)) & F_NSTACK) >> F_NSTACKSHIFT;
@@ -1556,18 +1556,18 @@
     "set the depth of the local stack.
 
      WARNING: for internal use by the compiler only.
-              playing around here with incorrect values 
-              may crash smalltalk badly.
-              (if the runtime library was compiled with DEBUG, 
-               a bad stack will be detected and triggers an error)"
+	      playing around here with incorrect values
+	      may crash smalltalk badly.
+	      (if the runtime library was compiled with DEBUG,
+	       a bad stack will be detected and triggers an error)"
 
 %{  /* NOCONTEXT */
     INT f = __intVal(__INST(flags));
 
     /* made this a primitive to get define in stc.h */
     if (__isSmallInteger(aNumber)) {
-        f = (f & ~F_NSTACK) | (__intVal(aNumber) << F_NSTACKSHIFT);
-        __INST(flags) = __mkSmallInteger(f);
+	f = (f & ~F_NSTACK) | (__intVal(aNumber) << F_NSTACKSHIFT);
+	__INST(flags) = __mkSmallInteger(f);
     }
 %}
 
@@ -1576,7 +1576,7 @@
 !CompiledCode methodsFor:'queries'!
 
 argumentCount
-    "ANSI alias for numArgs: return the number of arguments, the method expects." 
+    "ANSI alias for numArgs: return the number of arguments, the method expects."
 
 %{  /* NOCONTEXT */
     /* made this a primitive to get define in stc.h */
@@ -1590,8 +1590,8 @@
     "
 
     "
-     (Method compiledMethodAt:#source) numArgs  
-     (Method compiledMethodAt:#source:) numArgs 
+     (Method compiledMethodAt:#source) numArgs
+     (Method compiledMethodAt:#source:) numArgs
     "
 !
 
@@ -1600,13 +1600,13 @@
 
     decompilerClass := self decompilerClass.
     decompilerClass isNil ifTrue:[
-        ^ false
+	^ false
     ].
 
     Autoload autoloadFailedSignal handle:[:ex |
-        ^ false.
+	^ false.
     ] do:[
-        decompilerClass autoload.
+	decompilerClass autoload.
     ].
 
     decompiler := decompilerClass new.
@@ -1696,27 +1696,27 @@
 
     symbolSet := IdentitySet new.
     self literalsDo: [ :lit |
-        lit isSymbol ifTrue: [
-            symbolSet add: lit
-        ] ifFalse: [
-            lit isArray ifTrue: [
-                lit traverse: [ :el |
-                    el isSymbol ifTrue: [symbolSet add: el]
-                ]
-            ]
-        ]
+	lit isSymbol ifTrue: [
+	    symbolSet add: lit
+	] ifFalse: [
+	    lit isArray ifTrue: [
+		lit traverse: [ :el |
+		    el isSymbol ifTrue: [symbolSet add: el]
+		]
+	    ]
+	]
     ].
     ^ symbolSet
 
     "
-     (CompiledCode compiledMethodAt:#messages) messages 
+     (CompiledCode compiledMethodAt:#messages) messages
     "
 
     "Modified: 25.6.1996 / 22:24:20 / stefan"
 !
 
 numArgs
-    "return the number of arguments, the method expects." 
+    "return the number of arguments, the method expects."
 
 %{  /* NOCONTEXT */
     /* made this a primitive to get define in stc.h */
@@ -1730,13 +1730,13 @@
     "
 
     "
-     (Method compiledMethodAt:#source) numArgs  
-     (Method compiledMethodAt:#source:) numArgs 
+     (Method compiledMethodAt:#source) numArgs
+     (Method compiledMethodAt:#source:) numArgs
     "
 !
 
 numVars
-    "return the number of block local variables. 
+    "return the number of block local variables.
      Do not depend on the returned value - future optimizations
      may change things here (i.e. when moving locals into
      surrounding context for inlining).
@@ -1764,7 +1764,7 @@
 
     "
      (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#referencesLiteral:
-     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#bla               
+     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#bla
     "
 
     "Modified: / 24.6.1996 / 15:41:59 / stefan"
@@ -1776,13 +1776,13 @@
      matches the given pattern."
 
     ^ (self literalsDetect:[:mthdLit|
-                                (mthdLit isMemberOf:Symbol) 
-                                  and:[aMatchPattern match:mthdLit]
-                           ] ifNone:[false]) ~~ false.
+				(mthdLit isMemberOf:Symbol)
+				  and:[aMatchPattern match:mthdLit]
+			   ] ifNone:[false]) ~~ false.
 
     "
      (CompiledCode compiledMethodAt:#referencesGlobalMatching:) referencesGlobalMatching:'*atch*'
-     (CompiledCode compiledMethodAt:#referencesGlobalMatching:) referencesGlobalMatching:'*batch*' 
+     (CompiledCode compiledMethodAt:#referencesGlobalMatching:) referencesGlobalMatching:'*batch*'
     "
 
     "Modified: / 9.11.1999 / 17:03:16 / cg"
@@ -1795,8 +1795,8 @@
 
     lit := aLiteral.
     aLiteral isAssociation ifTrue:[
-        "/ for ST80 compatibility (where variableBindings are used ...)
-        lit := lit key
+	"/ for ST80 compatibility (where variableBindings are used ...)
+	lit := lit key
     ].
 
     ^ (self literalsDetect:[:mthdLit| mthdLit == lit] ifNone:[false]) ~~ false.
@@ -1815,17 +1815,17 @@
     "return true if the receiver or recursively any array element in the
      receiver refers to aLiteral (i.e. a deep search)"
 
-    self literalsDo: [ :el | 
-        el == aLiteral ifTrue:[^true].
-        el class == Array ifTrue:[
-            (el refersToLiteral: aLiteral) ifTrue: [^true]
-        ]
+    self literalsDo: [ :el |
+	el == aLiteral ifTrue:[^true].
+	el class == Array ifTrue:[
+	    (el refersToLiteral: aLiteral) ifTrue: [^true]
+	]
     ].
     ^ false
 
     "
-     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#foo  
-     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#class  
+     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#foo
+     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#class
     "
 
     "Modified: / 3.3.1998 / 00:02:28 / stefan"
@@ -1835,15 +1835,15 @@
 !CompiledCode class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.113 2012/03/05 14:52:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.114 2012/03/26 17:02:56 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.113 2012/03/05 14:52:16 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.114 2012/03/26 17:02:56 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: CompiledCode.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: CompiledCode.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 
--- a/EncodedStream.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/EncodedStream.st	Fri Apr 13 14:18:13 2012 +0100
@@ -45,10 +45,6 @@
 decodedStreamFor:aStream
     |encoding decoder decodedStream|
 
-    "/ setup for no-encoding; allows for a later switch to a real encoder,
-    "/ whenever an encoding pragma is encountered later.
-    decoder := CharacterEncoder nullEncoderInstance.
-
     aStream isPositionable ifTrue:[
         encoding := CharacterEncoder guessEncodingOfStream:aStream.
         (encoding notNil
@@ -57,7 +53,12 @@
             decoder := CharacterEncoder encoderFor:encoding.
         ].
     ].
-    decodedStream := EncodedStream stream:aStream encoder:decoder.
+    decoder isNil ifTrue:[
+        "/ setup for no-encoding; allows for a later switch to a real encoder,
+        "/ whenever an encoding pragma is encountered later.
+        decoder := CharacterEncoder nullEncoderInstance.
+    ].
+    decodedStream := self stream:aStream encoder:decoder.
     decodedStream skipEncodingChunk.
     ^ decodedStream
 ! !
@@ -249,7 +250,7 @@
 !EncodedStream methodsFor:'utilities'!
 
 skipEncodingChunk
-    |pos chunk tree|
+    |pos chunk token|
 
     stream isPositionable ifFalse:[
         ^ self
@@ -257,22 +258,44 @@
 
     pos := self position.
     chunk := self nextChunk.
-    tree := (Parser parseExpression:chunk).
-    "/ if this is a valid chunk (i.e. not a comment or encoding-directive),
-    "/ then position back, so it will be processed as usual.
-    tree notNil ifTrue:[
-        self position:pos
-    ]
+    [
+        "/ if this is a valid chunk (i.e. not a comment or encoding-directive),
+        "/ then position back, so it will be processed as usual.
+"/ We could parse here, but this is overkill, since we are only interested in the fact,
+"/ that there is anything else than a comment in the chunk.
+"/        result := (Parser for:chunk)
+"/            ignoreErrors:true;
+"/            ignoreWarnings:true;
+"/            parseMethodBody.
+
+        token := (Scanner for:chunk)
+                     ignoreErrors:true;
+                     ignoreWarnings:true;
+                     nextToken.
+
+        token ~= #EOF ifTrue:[
+            self position:pos
+        ].
+    ] on:Parser parseWarningSignal do:[:ex|
+        "really ignore any error.
+         Even setting ignorError will output diagnostics here
+         during standalone startup when debugging"
+        ex proceedWith:#ignore.
+    ].
 
     "Modified: / 29-07-2011 / 17:42:11 / cg"
 ! !
 
 !EncodedStream class methodsFor:'documentation'!
 
+version
+    ^ '$Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.25 2012/04/05 10:01:32 stefan Exp $'
+!
+
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.20 2011/07/29 15:43:00 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/EncodedStream.st,v 1.25 2012/04/05 10:01:32 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: EncodedStream.st 10775 2012-02-11 22:04:14Z vranyj1 $'
+    ^ '$Id: EncodedStream.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
--- a/ExternalBytes.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/ExternalBytes.st	Fri Apr 13 14:18:13 2012 +0100
@@ -813,134 +813,134 @@
     REGISTER unsigned char *dst;
     OBJ cls;
 
-    if ((__isBytes(aCollection) || __isExternalBytesLike(aCollection))
+    if ((__isBytes(aCollection) || __isWords(aCollection) || __isExternalBytesLike(aCollection))
      && __bothSmallInteger(start, stop)
      && __isSmallInteger(repStart)) {
-	startIndex = __intVal(start) - 1;
-	if (startIndex >= 0) {
-	    dst = (unsigned char *)__INST(address_) + startIndex;
-	    nIndex = __smallIntegerVal(__INST(size));
+        startIndex = __intVal(start) - 1;
+        if (startIndex >= 0) {
+            dst = (unsigned char *)__INST(address_) + startIndex;
+            nIndex = __smallIntegerVal(__INST(size));
 
-	    stopIndex = __intVal(stop) - 1;
-	    count = stopIndex - startIndex + 1;
-	    if (count == 0) {
-		RETURN ( self );
-	    }
+            stopIndex = __intVal(stop) - 1;
+            count = stopIndex - startIndex + 1;
+            if (count == 0) {
+                RETURN ( self );
+            }
 
-	    if ((count > 0) && (stopIndex < nIndex)) {
-		repStartIndex = __intVal(repStart) - 1;
-		if (repStartIndex >= 0) {
-		    if (__isExternalBytesLike(aCollection)) {
-			OBJ sz;
+            if ((count > 0) && (stopIndex < nIndex)) {
+                repStartIndex = __intVal(repStart) - 1;
+                if (repStartIndex >= 0) {
+                    if (__isExternalBytesLike(aCollection)) {
+                        OBJ sz;
 
-			src = __externalBytesVal(aCollection);
-			if (src == 0) goto fallBack;
+                        src = __externalBytesVal(aCollection);
+                        if (src == 0) goto fallBack;
 
-			sz = __externalBytesSize(aCollection);
-			if (__isSmallInteger(sz)) {
-			    repNIndex = __smallIntegerVal(sz);
-			} else {
-			    repNIndex = -1; /* unknown */
-			}
-			src = src + repStartIndex;
-		    } else {
-			repNIndex = __qSize(aCollection) - OHDR_SIZE;
-			src = __byteArrayVal(aCollection) + repStartIndex;
-			if ((cls = __qClass(aCollection)) != @global(ByteArray)) {
-			    int nInst;
+                        sz = __externalBytesSize(aCollection);
+                        if (__isSmallInteger(sz)) {
+                            repNIndex = __smallIntegerVal(sz);
+                        } else {
+                            repNIndex = -1; /* unknown */
+                        }
+                        src = src + repStartIndex;
+                    } else {
+                        repNIndex = __qSize(aCollection) - OHDR_SIZE;
+                        src = __byteArrayVal(aCollection) + repStartIndex;
+                        if ((cls = __qClass(aCollection)) != @global(ByteArray)) {
+                            int nInst;
 
-			    nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-			    src += nInst;
-			    repNIndex -= nInst;
-			}
-		    }
+                            nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+                            src += nInst;
+                            repNIndex -= nInst;
+                        }
+                    }
 
-		    repStopIndex = repStartIndex + (stopIndex - startIndex);
-		    if (repStopIndex < repNIndex) {
-			if (aCollection == self) {
-			    /* take care of overlapping copy */
-			    if (src < dst) {
-				/* must do a reverse copy */
-				src += count;
-				dst += count;
-				while (count-- > 0) {
-				    *--dst = *--src;
-				}
-				RETURN ( self );
-			    }
-			}
+                    repStopIndex = repStartIndex + (stopIndex - startIndex);
+                    if (repStopIndex < repNIndex) {
+                        if (aCollection == self) {
+                            /* take care of overlapping copy */
+                            if (src < dst) {
+                                /* must do a reverse copy */
+                                src += count;
+                                dst += count;
+                                while (count-- > 0) {
+                                    *--dst = *--src;
+                                }
+                                RETURN ( self );
+                            }
+                        }
 
 #ifdef memcpy4
-			if (((unsigned INT)src & 3) == ((unsigned INT)dst & 3)) {
-			    int nW;
+                        if (((unsigned INT)src & 3) == ((unsigned INT)dst & 3)) {
+                            int nW;
 
-			    /* copy unaligned part */
-			    while (count && ((unsigned INT)src & 3)) {
-				*dst++ = *src++;
-				count--;
-			    }
+                            /* copy unaligned part */
+                            while (count && ((unsigned INT)src & 3)) {
+                                *dst++ = *src++;
+                                count--;
+                            }
 
-			    if (count > 0) {
-				/* copy aligned part */
-				nW = count >> 2;
-				memcpy4(dst, src, nW);
-				if ((count = count & 3) != 0) {
-				    /* copy any remaining part */
-				    src += (nW<<2);
-				    dst += (nW<<2);
-				    while (count--) {
-					*dst++ = *src++;
-				    }
-				}
-			    }
-			    RETURN ( self );
-			}
+                            if (count > 0) {
+                                /* copy aligned part */
+                                nW = count >> 2;
+                                memcpy4(dst, src, nW);
+                                if ((count = count & 3) != 0) {
+                                    /* copy any remaining part */
+                                    src += (nW<<2);
+                                    dst += (nW<<2);
+                                    while (count--) {
+                                        *dst++ = *src++;
+                                    }
+                                }
+                            }
+                            RETURN ( self );
+                        }
 #else
 # if __POINTER_SIZE__ == 8
-			if (((unsigned INT)src & 7) == ((unsigned INT)dst & 7)) {
-			    /* copy unaligned part */
-			    while (count && ((unsigned INT)src & 7)) {
-				*dst++ = *src++;
-				count--;
-			    }
+                        if (((unsigned INT)src & 7) == ((unsigned INT)dst & 7)) {
+                            /* copy unaligned part */
+                            while (count && ((unsigned INT)src & 7)) {
+                                *dst++ = *src++;
+                                count--;
+                            }
 
-			    /* copy aligned part */
-			    while (count >= 8) {
-				((unsigned INT *)dst)[0] = ((unsigned INT *)src)[0];
-				dst += 8;
-				src += 8;
-				count -= 8;
-			    }
-			    while (count--) {
-				*dst++ = *src++;
-			    }
-			    RETURN ( self );
-			}
+                            /* copy aligned part */
+                            while (count >= 8) {
+                                ((unsigned INT *)dst)[0] = ((unsigned INT *)src)[0];
+                                dst += 8;
+                                src += 8;
+                                count -= 8;
+                            }
+                            while (count--) {
+                                *dst++ = *src++;
+                            }
+                            RETURN ( self );
+                        }
 # endif /* 64bit */
 #endif /* memcpy4 */
 
 #ifdef FAST_MEMCPY
-			memcpy(dst, src, count);
+                        memcpy(dst, src, count);
 #else
 # ifdef __UNROLL_LOOPS__
-			while (count >= 8) {
-			    dst[0] = src[0]; dst[1] = src[1];
-			    dst[2] = src[2]; dst[3] = src[3];
-			    dst[4] = src[4]; dst[5] = src[5];
-			    dst[6] = src[6]; dst[7] = src[7];
-			    dst += 8; src += 8;
-			    count -= 8;
-			}
+                        while (count >= 8) {
+                            dst[0] = src[0]; dst[1] = src[1];
+                            dst[2] = src[2]; dst[3] = src[3];
+                            dst[4] = src[4]; dst[5] = src[5];
+                            dst[6] = src[6]; dst[7] = src[7];
+                            dst += 8; src += 8;
+                            count -= 8;
+                        }
 # endif /* __UNROLL_LOOPS__ */
-			while (count-- > 0) {
-			    *dst++ = *src++;
-			}
+                        while (count-- > 0) {
+                            *dst++ = *src++;
+                        }
 #endif
-			RETURN ( self );
-		    }
-		}
-	    }
-	}
+                        RETURN ( self );
+                    }
+                }
+            }
+        }
     }
 fallBack: ;
 %}.
@@ -951,29 +951,29 @@
 
     "
      (ExternalBytes unprotectedNew:16)
-	    replaceFrom:1 to:8
-	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-	    startingAt:1
+            replaceFrom:1 to:8
+            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+            startingAt:1
 
      (ExternalBytes unprotectedNew:16)
-	    replaceFrom:3 to:10
-	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-	    startingAt:4
+            replaceFrom:3 to:10
+            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+            startingAt:4
 
      (ExternalBytes unprotectedNew:16)
-	    replaceFrom:3 to:4
-	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-	    startingAt:1
+            replaceFrom:3 to:4
+            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+            startingAt:1
 
      (ExternalBytes unprotectedNew:16)
-	    replaceFrom:0 to:9
-	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-	    startingAt:1
+            replaceFrom:0 to:9
+            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+            startingAt:1
 
      (ExternalBytes unprotectedNew:16)
-	    replaceFrom:1 to:10
-	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-	    startingAt:0
+            replaceFrom:1 to:10
+            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+            startingAt:0
     "
 ! !
 
@@ -1301,18 +1301,24 @@
     ]].
 ! !
 
+!ExternalBytes methodsFor:'testing'!
+
+isExternalBytes
+    ^ true
+! !
+
 !ExternalBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.81 2011/09/15 12:22:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.83 2012/04/03 11:57:15 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.81 2011/09/15 12:22:19 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.83 2012/04/03 11:57:15 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ExternalBytes.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: ExternalBytes.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 ExternalBytes initialize!
--- a/ExternalStream.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/ExternalStream.st	Fri Apr 13 14:18:13 2012 +0100
@@ -114,7 +114,7 @@
 # define NOGDICAPMASKS
 # define NOMETAFILE
 # define NOMINMAX
-//#d efine NOOPENFILE
+//# define NOOPENFILE
 # define NOSOUND
 # define NOWH
 //# define NOCOMM
@@ -188,7 +188,7 @@
 # define DEBUGBUFFER(buf)  \
     if (((char *)(buf) >= __survStartPtr) \
      && ((char *)(buf) < __survEndPtr)) { \
-        __fatal0("read into survivor\n"); \
+	__fatal0("read into survivor\n"); \
     }
 
 #else
@@ -215,69 +215,69 @@
 
 #  define READ(ret,f, cp, n, handleType) \
       { int __res;\
-        HANDLE h; \
-        h = _get_osfhandle(fileno(f)); \
-        if ((handleType == @symbol(socketFilePointer)) \
-        || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
-          (ret) = __STX_WSA_NOINT_CALL4("recv", recv, h, (cp), (n), 0);\
-        } else { \
-          (ret) = __STX_C_NOINT_CALL3("_rtl_read", _rtl_read, fileno(f), (cp), (n));\
-        } \
+	HANDLE h; \
+	h = _get_osfhandle(fileno(f)); \
+	if ((handleType == @symbol(socketFilePointer)) \
+	|| ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
+	  (ret) = __STX_WSA_NOINT_CALL4("recv", recv, h, (cp), (n), 0);\
+	} else { \
+	  (ret) = __STX_C_NOINT_CALL3("_rtl_read", _rtl_read, fileno(f), (cp), (n));\
+	} \
       }
 
 #  define WRITE(ret,f, cp, n, handleType) \
       { int __res;\
-        HANDLE h; \
-        h = _get_osfhandle(fileno(f)); \
-        if ((handleType == @symbol(socketFilePointer)) \
-        || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
-          (ret) = __STX_WSA_NOINT_CALL4("send", send, h, (cp), (n), 0);\
-        } else { \
-          (ret) = __STX_C_NOINT_CALL3("_rtl_write", _rtl_write, fileno(f), (cp), (n));\
-        } \
+	HANDLE h; \
+	h = _get_osfhandle(fileno(f)); \
+	if ((handleType == @symbol(socketFilePointer)) \
+	|| ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
+	  (ret) = __STX_WSA_NOINT_CALL4("send", send, h, (cp), (n), 0);\
+	} else { \
+	  (ret) = __STX_C_NOINT_CALL3("_rtl_write", _rtl_write, fileno(f), (cp), (n));\
+	} \
       }
 
 # else /* MSC */
 
 #  define READ(ret,f, cp, n, handleType) \
       { int __res;\
-        int fd; \
-        HANDLE h; \
-        fd = fileno(f); \
-        if ((handleType == @symbol(socketFileDescriptor)) \
-         || ((handleType == nil) && (ioctlsocket((SOCKET)fd,FIONREAD,&__res)==0))) { \
-          (ret) = __STX_WSA_NOINT_CALL4("recv", recv, fd, (cp), (n), 0);\
-        } else { \
-          h = _get_osfhandle(fd); \
-          if ((handleType == @symbol(socketFilePointer)) \
-          || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
-            (ret) = __STX_WSA_NOINT_CALL4("recv", recv, h, (cp), (n), 0);\
-          } else { \
-            (ret) = __STX_API_NOINT_CALL5("ReadFile", ReadFile, h, (cp), (n), &__res, 0);\
-            if (ret) \
-              ret = __res; \
-          } \
-        } \
+	int fd; \
+	HANDLE h; \
+	fd = fileno(f); \
+	if ((handleType == @symbol(socketFileDescriptor)) \
+	 || ((handleType == nil) && (ioctlsocket((SOCKET)fd,FIONREAD,&__res)==0))) { \
+	  (ret) = __STX_WSA_NOINT_CALL4("recv", recv, fd, (cp), (n), 0);\
+	} else { \
+	  h = _get_osfhandle(fd); \
+	  if ((handleType == @symbol(socketFilePointer)) \
+	  || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
+	    (ret) = __STX_WSA_NOINT_CALL4("recv", recv, h, (cp), (n), 0);\
+	  } else { \
+	    (ret) = __STX_API_NOINT_CALL5("ReadFile", ReadFile, h, (cp), (n), &__res, 0);\
+	    if (ret) \
+	      ret = __res; \
+	  } \
+	} \
       }
 #  define WRITE(ret,f, cp, n, handleType) \
       { int __res;\
-        int fd; \
-        HANDLE h; \
-        fd = fileno(f); \
-        if ((handleType == @symbol(socketFileDescriptor)) \
-         || ((handleType == nil) && (ioctlsocket((SOCKET)fd,FIONREAD,&__res)==0))) { \
-          (ret) = __STX_WSA_NOINT_CALL4("send", send, fd, (cp), (n), 0);\
-        } else {\
-          h = _get_osfhandle(fd); \
-          if ((handleType == @symbol(socketFilePointer)) \
-          || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
-            (ret) = __STX_WSA_NOINT_CALL4("send", send, h, (cp), (n), 0);\
-          } else {\
-            (ret) = __STX_API_NOINT_CALL5("WriteFile", WriteFile, h, (cp), (n), &__res, 0);\
-            if (ret) \
-              ret = __res; \
-          } \
-        } \
+	int fd; \
+	HANDLE h; \
+	fd = fileno(f); \
+	if ((handleType == @symbol(socketFileDescriptor)) \
+	 || ((handleType == nil) && (ioctlsocket((SOCKET)fd,FIONREAD,&__res)==0))) { \
+	  (ret) = __STX_WSA_NOINT_CALL4("send", send, fd, (cp), (n), 0);\
+	} else {\
+	  h = _get_osfhandle(fd); \
+	  if ((handleType == @symbol(socketFilePointer)) \
+	  || ((handleType == nil) && (ioctlsocket((SOCKET)h,FIONREAD,&__res)==0))) { \
+	    (ret) = __STX_WSA_NOINT_CALL4("send", send, h, (cp), (n), 0);\
+	  } else {\
+	    (ret) = __STX_API_NOINT_CALL5("WriteFile", WriteFile, h, (cp), (n), &__res, 0);\
+	    if (ret) \
+	      ret = __res; \
+	  } \
+	} \
       }
 # endif /* MSC */
 
@@ -289,56 +289,56 @@
 # define __READING__(f)                          \
     if ((__INST(didWrite) != false)              \
      && (__INST(mode) == @symbol(readwrite))) {  \
-        __INST(didWrite) = false;                \
-        OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
+	__INST(didWrite) = false;                \
+	OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
     }
 
 # define __WRITING__(f)                          \
     if ((__INST(didWrite) != true)               \
      && (__INST(mode) == @symbol(readwrite))) {  \
-        __INST(didWrite) = true;                 \
-        OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
+	__INST(didWrite) = true;                 \
+	OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
     }
 
 # define __UNGETC__(c, f, isBuffered)                   \
     if (isBuffered) {                                   \
-        ungetc((c), (f));                               \
+	ungetc((c), (f));                               \
     } else {                                            \
       __INST(readAhead) = __mkSmallInteger((c));            \
     }
 
 # define __READBYTE__(ret, f, buf, isBuffered, handleType)          \
     if (isBuffered) {                                   \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) >= 0) {                           \
-                *(buf) = (ret);                         \
-                (ret) = 1;                              \
-            } else if (ferror(f)) {                     \
-                if (__threadErrno == EINTR) {           \
-                    clearerr(f);                        \
-                    continue;                           \
-                }                                       \
-            } else {                                    \
-                (ret) = 0;                              \
-            }                                           \
-            break;                                      \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) >= 0) {                           \
+		*(buf) = (ret);                         \
+		(ret) = 1;                              \
+	    } else if (ferror(f)) {                     \
+		if (__threadErrno == EINTR) {           \
+		    clearerr(f);                        \
+		    continue;                           \
+		}                                       \
+	    } else {                                    \
+		(ret) = 0;                              \
+	    }                                           \
+	    break;                                      \
+	}                                               \
     } else {                                            \
-        OBJ rA = __INST(readAhead);                     \
-        if (rA != nil) {                                \
-            *(buf) = (char)__intVal(rA);                \
-            __INST(readAhead) = nil;                    \
-            (ret) = 1;                                  \
-        } else {                                        \
-            for (;;) {                                  \
-                CLEAR_ERRNO;                            \
-                READ(ret,f, buf, 1, handleType);                    \
-                if ((ret) >= 0 || __threadErrno != EINTR)       \
-                    break;                              \
-            }                                           \
-        }                                               \
+	OBJ rA = __INST(readAhead);                     \
+	if (rA != nil) {                                \
+	    *(buf) = (char)__intVal(rA);                \
+	    __INST(readAhead) = nil;                    \
+	    (ret) = 1;                                  \
+	} else {                                        \
+	    for (;;) {                                  \
+		CLEAR_ERRNO;                            \
+		READ(ret,f, buf, 1, handleType);                    \
+		if ((ret) >= 0 || __threadErrno != EINTR)       \
+		    break;                              \
+	    }                                           \
+	}                                               \
     }
 
   /*
@@ -348,120 +348,120 @@
 # define __READBYTES__(ret, f, buf, cnt, isBuffered, handleType)    \
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__offs++] = (ret);                    \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__offs++] = (ret);                    \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int __offs = 0;                                 \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__offs] = __intVal(rA);           \
-                __INST(readAhead) = nil;                \
-                (ret) = 1;                              \
-            } else {                                    \
-                CLEAR_ERRNO;                            \
-                READ(ret,f, (buf)+__offs, (cnt)-__offs, handleType); \
-                if ((ret) <= 0) {                       \
-                    if ((ret) < 0 && __threadErrno == EINTR) {  \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__offs] = __intVal(rA);           \
+		__INST(readAhead) = nil;                \
+		(ret) = 1;                              \
+	    } else {                                    \
+		CLEAR_ERRNO;                            \
+		READ(ret,f, (buf)+__offs, (cnt)-__offs, handleType); \
+		if ((ret) <= 0) {                       \
+		    if ((ret) < 0 && __threadErrno == EINTR) {  \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 
 # define __READAVAILBYTES__(ret, f, buf, cnt, isBuffered, handleType) \
   {                                                     \
     int __offs = 0;                                     \
     int oldFlags;                                       \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__offs++] = (ret);                    \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__offs++] = (ret);                    \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__offs] = __intVal(rA);           \
-                __INST(readAhead) = nil;                \
-                (ret) = 1;                              \
-                __offs += (ret);                        \
-                continue;                               \
-            }                                           \
-            CLEAR_ERRNO;                                \
-            {                                           \
-              int res;                                  \
-              if ((handleType == @symbol(socketFilePointer)) \
-               || ((handleType == nil) && (ioctlsocket((SOCKET)_get_osfhandle(fileno(f)),FIONREAD,&res)==0))) { \
-                  if (res > 0) {                        \
-                      if (res > ((cnt)-__offs))         \
-                        res = (cnt)-__offs;             \
-                      READ(ret,f, (buf)+__offs, res, handleType);   \
-                  } else {                              \
-                      (ret) = 0;                        \
-                  }                                     \
-              } else if ((handleType == @symbol(pipeFilePointer)) \
-                         || ((handleType == nil) && (PeekNamedPipe((HANDLE)_get_osfhandle(fileno(f)),0, 0,0,&res,0)))) { \
-                  if (res > 0) {                        \
-                      if (res > ((cnt)-__offs))         \
-                        res = (cnt)-__offs;             \
-                      READ(ret,f, (buf)+__offs, res, handleType);   \
-                  } else                                \
-                      ret = 0;                          \
-              } else {                                  \
-                  READ(ret,f, (buf)+__offs, (cnt)-__offs, handleType); \
-              }                                         \
-            }                                           \
-            if ((ret) < 0) {                            \
-                if (__threadErrno == EINTR) {                   \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-            break;                                      \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__offs] = __intVal(rA);           \
+		__INST(readAhead) = nil;                \
+		(ret) = 1;                              \
+		__offs += (ret);                        \
+		continue;                               \
+	    }                                           \
+	    CLEAR_ERRNO;                                \
+	    {                                           \
+	      int res;                                  \
+	      if ((handleType == @symbol(socketFilePointer)) \
+	       || ((handleType == nil) && (ioctlsocket((SOCKET)_get_osfhandle(fileno(f)),FIONREAD,&res)==0))) { \
+		  if (res > 0) {                        \
+		      if (res > ((cnt)-__offs))         \
+			res = (cnt)-__offs;             \
+		      READ(ret,f, (buf)+__offs, res, handleType);   \
+		  } else {                              \
+		      (ret) = 0;                        \
+		  }                                     \
+	      } else if ((handleType == @symbol(pipeFilePointer)) \
+			 || ((handleType == nil) && (PeekNamedPipe((HANDLE)_get_osfhandle(fileno(f)),0, 0,0,&res,0)))) { \
+		  if (res > 0) {                        \
+		      if (res > ((cnt)-__offs))         \
+			res = (cnt)-__offs;             \
+		      READ(ret,f, (buf)+__offs, res, handleType);   \
+		  } else                                \
+		      ret = 0;                          \
+	      } else {                                  \
+		  READ(ret,f, (buf)+__offs, (cnt)-__offs, handleType); \
+	      }                                         \
+	    }                                           \
+	    if ((ret) < 0) {                            \
+		if (__threadErrno == EINTR) {                   \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	    break;                                      \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -472,63 +472,63 @@
     int __ooffs = obj_offs;                             \
     int __offs = 0;                                     \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {       \
-                        clearerr(f);                    \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        continue;                       \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__ooffs+__offs] = (ret);              \
-            __offs++;                                   \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {       \
+			clearerr(f);                    \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			continue;                       \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__ooffs+__offs] = (ret);              \
+	    __offs++;                                   \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        while (__offs < (cnt)) {                        \
-            char __buf[IO_BUFFER_SIZE];                 \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__ooffs+__offs] = __intVal(rA);   \
-                __INST(readAhead) = nil;                \
-                (ret) = 1;                              \
-            } else {                                    \
-                int l;                                  \
-                CLEAR_ERRNO;                            \
-                l = (cnt)-__offs;                       \
-                if ( l > IO_BUFFER_SIZE)                \
-                  l = IO_BUFFER_SIZE;                   \
-                READ(ret,f, __buf, l, handleType);                  \
-                if ((ret) <= 0) {                       \
-                    if ((ret) < 0 && __threadErrno == EINTR) {  \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-            }                                           \
-            if( (ret) > 0 ) {                               \
-                /* refetch */                               \
-                buf = (volatile char *)(obj);               \
-                memcpy((buf)+__ooffs+__offs,__buf,(ret));   \
-                __offs += (ret);                            \
-            } else {                                        \
-                (ret) = 0;                                  \
-            }                                               \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    char __buf[IO_BUFFER_SIZE];                 \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__ooffs+__offs] = __intVal(rA);   \
+		__INST(readAhead) = nil;                \
+		(ret) = 1;                              \
+	    } else {                                    \
+		int l;                                  \
+		CLEAR_ERRNO;                            \
+		l = (cnt)-__offs;                       \
+		if ( l > IO_BUFFER_SIZE)                \
+		  l = IO_BUFFER_SIZE;                   \
+		READ(ret,f, __buf, l, handleType);                  \
+		if ((ret) <= 0) {                       \
+		    if ((ret) < 0 && __threadErrno == EINTR) {  \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+	    }                                           \
+	    if( (ret) > 0 ) {                               \
+		/* refetch */                               \
+		buf = (volatile char *)(obj);               \
+		memcpy((buf)+__ooffs+__offs,__buf,(ret));   \
+		__offs += (ret);                            \
+	    } else {                                        \
+		(ret) = 0;                                  \
+	    }                                               \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -537,147 +537,147 @@
     int __ooffs = obj_offs;                          \
     int __offs = 0;                                  \
     char *buf = (char *)(obj);                       \
-                                                     \
+						     \
     (ret) = 0;                                       \
     if (isBuffered) {                                \
-        while (__offs < (cnt)) {                     \
-            CLEAR_ERRNO;                             \
-            (ret) = getc(f);                         \
-            if ((ret) < 0) {                         \
-                if (ferror(f)) {                     \
-                    if (__threadErrno == EINTR) {    \
-                        clearerr(f);                 \
-                        /* refetch */                \
-                        buf = (volatile char *)(obj);\
-                        continue;                    \
-                    }                                \
-                } else {                             \
-                    (ret) = 0;                       \
-                }                                    \
-                break;                               \
-            }                                        \
-            (buf)[__ooffs+__offs] = (ret);           \
-            __offs++;                                \
-        }                                            \
-        if (__offs > 0)                              \
-            (ret) = __offs;                          \
+	while (__offs < (cnt)) {                     \
+	    CLEAR_ERRNO;                             \
+	    (ret) = getc(f);                         \
+	    if ((ret) < 0) {                         \
+		if (ferror(f)) {                     \
+		    if (__threadErrno == EINTR) {    \
+			clearerr(f);                 \
+			/* refetch */                \
+			buf = (volatile char *)(obj);\
+			continue;                    \
+		    }                                \
+		} else {                             \
+		    (ret) = 0;                       \
+		}                                    \
+		break;                               \
+	    }                                        \
+	    (buf)[__ooffs+__offs] = (ret);           \
+	    __offs++;                                \
+	}                                            \
+	if (__offs > 0)                              \
+	    (ret) = __offs;                          \
     } else {                                         \
-        while (__offs < (cnt)) {                     \
-            char __buf[IO_BUFFER_SIZE];              \
-            OBJ rA = __INST(readAhead);              \
-            if (rA != nil) {                         \
-                (buf)[__ooffs+__offs] = __intVal(rA);\
-                __INST(readAhead) = nil;             \
-                (ret) = 1;                           \
-                __offs += (ret);                     \
-                continue;                            \
-            }                                        \
-            {                                        \
-                int l;                               \
-                int res;                             \
-                CLEAR_ERRNO;                         \
-                l = (cnt)-__offs;                    \
-                if ( l > IO_BUFFER_SIZE)             \
-                    l = IO_BUFFER_SIZE;              \
-                if (ioctlsocket((SOCKET)_get_osfhandle(fileno(f)),FIONREAD,&res)==0) { \
-                    if (res > 0) {                   \
-                        if (res > l)                 \
-                            res = l;                 \
-                        READ(ret,f, __buf, res, handleType);     \
-                    } else {                         \
-                        (ret) = 0;                   \
-                    }                                \
-                } else if (PeekNamedPipe((HANDLE)_get_osfhandle(fileno(f)),0, 0,0,&res,0)) { \
-                    if (res > 0) {                   \
-                        if (res > l)                 \
-                            res = l;                 \
-                        READ(ret,f, __buf, res, handleType);     \
-                    } else                           \
-                        (ret) = 0;                   \
-                } else {                             \
-                    READ(ret,f, __buf, l, handleType);           \
-                }                                    \
-                if ((ret) < 0 && __threadErrno == EINTR) {   \
-                    continue;                        \
-                }                                    \
-            }                                        \
-            if( (ret) > 0 ) {                               \
-                /* refetch */                               \
-                buf = (volatile char *)(obj);               \
-                memcpy((buf)+__ooffs+__offs,__buf,(ret));   \
-                __offs += (ret);                            \
-            } else {                                        \
-                (ret) = 0;                                  \
-            }                                               \
-            break;                                      \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                     \
+	    char __buf[IO_BUFFER_SIZE];              \
+	    OBJ rA = __INST(readAhead);              \
+	    if (rA != nil) {                         \
+		(buf)[__ooffs+__offs] = __intVal(rA);\
+		__INST(readAhead) = nil;             \
+		(ret) = 1;                           \
+		__offs += (ret);                     \
+		continue;                            \
+	    }                                        \
+	    {                                        \
+		int l;                               \
+		int res;                             \
+		CLEAR_ERRNO;                         \
+		l = (cnt)-__offs;                    \
+		if ( l > IO_BUFFER_SIZE)             \
+		    l = IO_BUFFER_SIZE;              \
+		if (ioctlsocket((SOCKET)_get_osfhandle(fileno(f)),FIONREAD,&res)==0) { \
+		    if (res > 0) {                   \
+			if (res > l)                 \
+			    res = l;                 \
+			READ(ret,f, __buf, res, handleType);     \
+		    } else {                         \
+			(ret) = 0;                   \
+		    }                                \
+		} else if (PeekNamedPipe((HANDLE)_get_osfhandle(fileno(f)),0, 0,0,&res,0)) { \
+		    if (res > 0) {                   \
+			if (res > l)                 \
+			    res = l;                 \
+			READ(ret,f, __buf, res, handleType);     \
+		    } else                           \
+			(ret) = 0;                   \
+		} else {                             \
+		    READ(ret,f, __buf, l, handleType);           \
+		}                                    \
+		if ((ret) < 0 && __threadErrno == EINTR) {   \
+		    continue;                        \
+		}                                    \
+	    }                                        \
+	    if( (ret) > 0 ) {                               \
+		/* refetch */                               \
+		buf = (volatile char *)(obj);               \
+		memcpy((buf)+__ooffs+__offs,__buf,(ret));   \
+		__offs += (ret);                            \
+	    } else {                                        \
+		(ret) = 0;                                  \
+	    }                                               \
+	    break;                                      \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
 # define __WRITEBYTE__(ret, f, buf, isBuffered, handleType)         \
     if (isBuffered) {                                   \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            ret = putc(*(buf), f);                      \
-            if ((ret) >= 0) {                           \
-                (ret) = 1;                              \
-            } else if (ferror(f)) {                     \
-                if (__threadErrno == EINTR) {                   \
-                    clearerr(f);                        \
-                    continue;                           \
-                }                                       \
-            } else                                      \
-                (ret) = 0;                              \
-            break;                                      \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    ret = putc(*(buf), f);                      \
+	    if ((ret) >= 0) {                           \
+		(ret) = 1;                              \
+	    } else if (ferror(f)) {                     \
+		if (__threadErrno == EINTR) {                   \
+		    clearerr(f);                        \
+		    continue;                           \
+		}                                       \
+	    } else                                      \
+		(ret) = 0;                              \
+	    break;                                      \
+	}                                               \
     } else {                                            \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            WRITE(ret,f, buf, 1, handleType);                       \
-            if ((ret) >= 0 || __threadErrno != EINTR)           \
-                break;                                  \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    WRITE(ret,f, buf, 1, handleType);                       \
+	    if ((ret) >= 0 || __threadErrno != EINTR)           \
+		break;                                  \
+	}                                               \
    }
 
 # define __WRITEBYTES__(ret, f, buf, cnt, isBuffered, handleType)   \
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = fwrite((buf)+__offs, 1, (cnt)-__offs, f);\
-            if ((ret) <= 0) {                           \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = fwrite((buf)+__offs, 1, (cnt)-__offs, f);\
+	    if ((ret) <= 0) {                           \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            WRITE(ret,f, (buf)+__offs, (cnt)-__offs, handleType);   \
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR) {        \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    WRITE(ret,f, (buf)+__offs, (cnt)-__offs, handleType);   \
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR) {        \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 
 # define __WRITEBYTES_OBJ__(ret, f, obj, obj_offs, cnt, isBuffered, handleType) \
@@ -685,51 +685,51 @@
     int __ooffs = obj_offs;                             \
     int __offs = 0;                                     \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = fwrite((buf)+__ooffs+__offs, 1, (cnt)-__offs, f); \
-            if ((ret) <= 0) {                           \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {       \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = fwrite((buf)+__ooffs+__offs, 1, (cnt)-__offs, f); \
+	    if ((ret) <= 0) {                           \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {       \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        while (__offs < (cnt)) {                        \
-            char __buf[IO_BUFFER_SIZE];                 \
-            int l;                                      \
-            CLEAR_ERRNO;                                \
-            l = (cnt)-__offs;                           \
-            if ( l > IO_BUFFER_SIZE)                    \
-              l = IO_BUFFER_SIZE;                       \
-            /* refetch */                               \
-            buf = (volatile char *)(obj);               \
-            memcpy(__buf,(buf)+__ooffs+__offs,l);       \
-            WRITE(ret,f, __buf, l, handleType);                     \
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR) {        \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    char __buf[IO_BUFFER_SIZE];                 \
+	    int l;                                      \
+	    CLEAR_ERRNO;                                \
+	    l = (cnt)-__offs;                           \
+	    if ( l > IO_BUFFER_SIZE)                    \
+	      l = IO_BUFFER_SIZE;                       \
+	    /* refetch */                               \
+	    buf = (volatile char *)(obj);               \
+	    memcpy(__buf,(buf)+__ooffs+__offs,l);       \
+	    WRITE(ret,f, __buf, l, handleType);                     \
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR) {        \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -738,15 +738,15 @@
 # define __READING__(f)                          \
     if ((__INST(didWrite) != false)              \
      && (__INST(mode) == @symbol(readwrite))) {  \
-        __INST(didWrite) = false;                \
-        OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
+	__INST(didWrite) = false;                \
+	OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
     }
 
 # define __WRITING__(f)                          \
     if ((__INST(didWrite) != true)               \
      && (__INST(mode) == @symbol(readwrite))) {  \
-        __INST(didWrite) = true;                 \
-        OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
+	__INST(didWrite) = true;                 \
+	OPT_FSEEK(f, 0L, SEEK_CUR); /* needed in stdio */  \
     }
 
 
@@ -756,69 +756,69 @@
 # else /* use STDIO */
 #  define __UNGETC__(c, f, isBuffered)                  \
     if (isBuffered) {                                   \
-        ungetc((c), (f));                               \
+	ungetc((c), (f));                               \
     } else {                                            \
-        __INST(readAhead) = __mkSmallInteger((c));          \
+	__INST(readAhead) = __mkSmallInteger((c));          \
     }
 # endif /* use STDIO */
 
 # ifdef NO_STDIO
 #  define __READBYTE__(ret, f, buf, isBuffered, handleType)         \
     {                                                   \
-        OBJ rA = __INST(readAhead);                     \
-        if (rA != nil) {                                \
-            *(buf) = __intVal(rA);                      \
-            DEBUGBUFFER(buf);                           \
-            __INST(readAhead) = nil;                    \
-            (ret) = 1;                                  \
-        } else {                                        \
-            for (;;) {                                  \
-                CLEAR_ERRNO;                            \
-                (ret) = READ(f, buf, 1, handleType);                \
-                DEBUGBUFFER(buf);                       \
-                if ((ret) >= 0 || __threadErrno != EINTR)       \
-                    break;                              \
-                __HANDLE_INTERRUPTS__;                  \
-            }                                           \
-        }                                               \
+	OBJ rA = __INST(readAhead);                     \
+	if (rA != nil) {                                \
+	    *(buf) = __intVal(rA);                      \
+	    DEBUGBUFFER(buf);                           \
+	    __INST(readAhead) = nil;                    \
+	    (ret) = 1;                                  \
+	} else {                                        \
+	    for (;;) {                                  \
+		CLEAR_ERRNO;                            \
+		(ret) = READ(f, buf, 1, handleType);                \
+		DEBUGBUFFER(buf);                       \
+		if ((ret) >= 0 || __threadErrno != EINTR)       \
+		    break;                              \
+		__HANDLE_INTERRUPTS__;                  \
+	    }                                           \
+	}                                               \
     }
 # else /* use STDIO */
 #  define __READBYTE__(ret, f, buf, isBuffered, handleType)         \
     if (isBuffered) {                                   \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) >= 0) {                           \
-                DEBUGBUFFER(buf);                       \
-                *(buf) = (ret);                         \
-                (ret) = 1;                              \
-            } else if (ferror(f)) {                     \
-                if (__threadErrno == EINTR) {                   \
-                    __HANDLE_INTERRUPTS__;              \
-                    clearerr(f);                        \
-                    continue;                           \
-                }                                       \
-            } else                                      \
-                (ret) = 0;                              \
-            break;                                      \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) >= 0) {                           \
+		DEBUGBUFFER(buf);                       \
+		*(buf) = (ret);                         \
+		(ret) = 1;                              \
+	    } else if (ferror(f)) {                     \
+		if (__threadErrno == EINTR) {                   \
+		    __HANDLE_INTERRUPTS__;              \
+		    clearerr(f);                        \
+		    continue;                           \
+		}                                       \
+	    } else                                      \
+		(ret) = 0;                              \
+	    break;                                      \
+	}                                               \
     } else {                                            \
-        OBJ rA = __INST(readAhead);                     \
-        if (rA != nil) {                                \
-            *(buf) = __intVal(rA);                      \
-            DEBUGBUFFER(buf);                           \
-            __INST(readAhead) = nil;                    \
-            (ret) = 1;                                  \
-        } else {                                        \
-            for (;;) {                                  \
-                CLEAR_ERRNO;                            \
-                (ret) = read(fileno(f), buf, 1);        \
-                DEBUGBUFFER(buf);                       \
-                if ((ret) >= 0 || __threadErrno != EINTR)       \
-                    break;                              \
-                __HANDLE_INTERRUPTS__;                  \
-            }                                           \
-        }                                               \
+	OBJ rA = __INST(readAhead);                     \
+	if (rA != nil) {                                \
+	    *(buf) = __intVal(rA);                      \
+	    DEBUGBUFFER(buf);                           \
+	    __INST(readAhead) = nil;                    \
+	    (ret) = 1;                                  \
+	} else {                                        \
+	    for (;;) {                                  \
+		CLEAR_ERRNO;                            \
+		(ret) = read(fileno(f), buf, 1);        \
+		DEBUGBUFFER(buf);                       \
+		if ((ret) >= 0 || __threadErrno != EINTR)       \
+		    break;                              \
+		__HANDLE_INTERRUPTS__;                  \
+	    }                                           \
+	}                                               \
    }
 # endif /* use STDIO */
 
@@ -829,84 +829,84 @@
 # ifdef NO_STDIO
 #  define __READBYTES__(ret, f, buf, cnt, isBuffered, handleType)   \
     {                                                   \
-        int __offs = 0, __cnt;                                 \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__offs] = __intVal(rA);           \
-                DEBUGBUFFER(buf);                       \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-            } else {                                    \
-                CLEAR_ERRNO;                            \
-                __cnt = READ(f, (buf)+__offs, (cnt)-__offs, handleType); \
-                DEBUGBUFFER(buf);                       \
-                if (__cnt <= 0) {                       \
-                    if (__cnt < 0 && __threadErrno == EINTR) {  \
-                        __HANDLE_INTERRUPTS__;          \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-                __offs += __cnt;                        \
-            }                                           \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0, __cnt;                                 \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__offs] = __intVal(rA);           \
+		DEBUGBUFFER(buf);                       \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+	    } else {                                    \
+		CLEAR_ERRNO;                            \
+		__cnt = READ(f, (buf)+__offs, (cnt)-__offs, handleType); \
+		DEBUGBUFFER(buf);                       \
+		if (__cnt <= 0) {                       \
+		    if (__cnt < 0 && __threadErrno == EINTR) {  \
+			__HANDLE_INTERRUPTS__;          \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+		__offs += __cnt;                        \
+	    }                                           \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 # else /* use STDIO */
 #  define __READBYTES__(ret, f, buf, cnt, isBuffered, handleType)     \
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        __HANDLE_INTERRUPTS__;          \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            DEBUGBUFFER(buf);                           \
-            (buf)[__offs++] = (ret);                    \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			__HANDLE_INTERRUPTS__;          \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    DEBUGBUFFER(buf);                           \
+	    (buf)[__offs++] = (ret);                    \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int __offs = 0, __cnt;                                 \
-        int fd = fileno(f);                             \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                DEBUGBUFFER(buf);                       \
-                (buf)[__offs] = __intVal(rA);           \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-            } else {                                    \
-                CLEAR_ERRNO;                            \
-                __cnt = read(fd, (buf)+__offs, (cnt)-__offs);                 \
-                DEBUGBUFFER(buf);                       \
-                if (__cnt <= 0) {                       \
-                    if (__cnt < 0 && __threadErrno == EINTR) {  \
-                        __HANDLE_INTERRUPTS__;          \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-                __offs += __cnt;                        \
-            }                                           \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0, __cnt;                                 \
+	int fd = fileno(f);                             \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		DEBUGBUFFER(buf);                       \
+		(buf)[__offs] = __intVal(rA);           \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+	    } else {                                    \
+		CLEAR_ERRNO;                            \
+		__cnt = read(fd, (buf)+__offs, (cnt)-__offs);                 \
+		DEBUGBUFFER(buf);                       \
+		if (__cnt <= 0) {                       \
+		    if (__cnt < 0 && __threadErrno == EINTR) {  \
+			__HANDLE_INTERRUPTS__;          \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+		__offs += __cnt;                        \
+	    }                                           \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 
 
@@ -916,10 +916,10 @@
 
 #  if defined(F_GETFL) && defined(F_SETFL) && (defined(O_NONBLOCK) || defined(O_NDELAY) || defined(FNDELAY))
 #   define GETFLAGS(fd) \
-        fcntl(fd, F_GETFL, 0);
+	fcntl(fd, F_GETFL, 0);
 
 #   define SETFLAGS(fd, flags) \
-        fcntl(fd, F_SETFL, flags)
+	fcntl(fd, F_SETFL, flags)
 
 #   if defined(O_NONBLOCK)
 #    define __STX_NONBLOCK_FLAG O_NONBLOCK
@@ -932,13 +932,13 @@
 #   endif
 
 #   define SETNONBLOCKING(fd) \
-        { \
-            int flags; \
-            flags = fcntl(fd, F_GETFL, 0); \
-            if (flags >= 0) { \
-                fcntl(fd, F_SETFL, flags | __STX_NONBLOCK_FLAG); \
-            } \
-        }
+	{ \
+	    int flags; \
+	    flags = fcntl(fd, F_GETFL, 0); \
+	    if (flags >= 0) { \
+		fcntl(fd, F_SETFL, flags | __STX_NONBLOCK_FLAG); \
+	    } \
+	}
 #  else
 #   define GETFLAGS(fd) 0
 #   define SETFLAGS(fd, flags) /* nothing */
@@ -949,53 +949,53 @@
   {                                                     \
     int __offs = 0, __cnt;                                     \
     int oldFlags;                                       \
-                                                        \
+							\
     (ret) = 0;                                          \
     oldFlags = GETFLAGS(fileno(f));                     \
     SETNONBLOCKING(fileno(f));                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        (ret) = 0;                      \
-                        clearerr(f);                    \
-                        break;                          \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__offs++] = (ret);                    \
-            DEBUGBUFFER(buf);                           \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			(ret) = 0;                      \
+			clearerr(f);                    \
+			break;                          \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__offs++] = (ret);                    \
+	    DEBUGBUFFER(buf);                           \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int fd = fileno(f);                             \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__offs] = __intVal(rA);           \
-                DEBUGBUFFER(buf);                       \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-                continue;                               \
-            }                                           \
-            CLEAR_ERRNO;                                \
-            __cnt = read(fd, (buf)+__offs, (cnt)-__offs); \
-            DEBUGBUFFER(buf);                           \
-            if (__cnt > 0) {                            \
-                __offs += __cnt;                        \
-            }                                           \
-            break;                                      \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int fd = fileno(f);                             \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__offs] = __intVal(rA);           \
+		DEBUGBUFFER(buf);                       \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+		continue;                               \
+	    }                                           \
+	    CLEAR_ERRNO;                                \
+	    __cnt = read(fd, (buf)+__offs, (cnt)-__offs); \
+	    DEBUGBUFFER(buf);                           \
+	    if (__cnt > 0) {                            \
+		__offs += __cnt;                        \
+	    }                                           \
+	    break;                                      \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
     SETFLAGS(fileno(f), oldFlags);                      \
   }
@@ -1013,34 +1013,34 @@
     int __offs = 0;                                     \
     int __cnt;                                          \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     {                                                   \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__ooffs+__offs] = __intVal(rA);   \
-                DEBUGBUFFER(buf);                       \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-            } else {                                    \
-                CLEAR_ERRNO;                            \
-                __cnt = READ(f, (buf)+__ooffs+__offs, (cnt)-__offs, handleType); \
-                DEBUGBUFFER(buf);                       \
-                if (__cnt <= 0) {                       \
-                    if (__cnt < 0 && __threadErrno == EINTR) {  \
-                        __HANDLE_INTERRUPTS__;          \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-                __offs += __cnt;                        \
-            }                                           \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__ooffs+__offs] = __intVal(rA);   \
+		DEBUGBUFFER(buf);                       \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+	    } else {                                    \
+		CLEAR_ERRNO;                            \
+		__cnt = READ(f, (buf)+__ooffs+__offs, (cnt)-__offs, handleType); \
+		DEBUGBUFFER(buf);                       \
+		if (__cnt <= 0) {                       \
+		    if (__cnt < 0 && __threadErrno == EINTR) {  \
+			__HANDLE_INTERRUPTS__;          \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+		__offs += __cnt;                        \
+	    }                                           \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -1052,61 +1052,61 @@
     int __offs = 0;                                     \
     int __cnt;                                          \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {       \
-                        __HANDLE_INTERRUPTS__;          \
-                        clearerr(f);                    \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        DEBUGBUFFER(buf);               \
-                        continue;                       \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__ooffs+__offs] = (ret);              \
-            DEBUGBUFFER(buf);                           \
-            __offs++;                                   \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {       \
+			__HANDLE_INTERRUPTS__;          \
+			clearerr(f);                    \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			DEBUGBUFFER(buf);               \
+			continue;                       \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__ooffs+__offs] = (ret);              \
+	    DEBUGBUFFER(buf);                           \
+	    __offs++;                                   \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int fd = fileno(f);                             \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__ooffs+__offs] = __intVal(rA);   \
-                DEBUGBUFFER(buf);                       \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-            } else {                                    \
-                CLEAR_ERRNO;                            \
-                __cnt = read(fd, (buf)+__ooffs+__offs, (cnt)-__offs); \
-                DEBUGBUFFER(buf);                       \
-                if (__cnt <= 0) {                       \
-                    if (__cnt < 0 && __threadErrno == EINTR) {  \
-                        __HANDLE_INTERRUPTS__;          \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                }                                       \
-                __offs += __cnt;                        \
-            }                                           \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int fd = fileno(f);                             \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__ooffs+__offs] = __intVal(rA);   \
+		DEBUGBUFFER(buf);                       \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+	    } else {                                    \
+		CLEAR_ERRNO;                            \
+		__cnt = read(fd, (buf)+__ooffs+__offs, (cnt)-__offs); \
+		DEBUGBUFFER(buf);                       \
+		if (__cnt <= 0) {                       \
+		    if (__cnt < 0 && __threadErrno == EINTR) {  \
+			__HANDLE_INTERRUPTS__;          \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		}                                       \
+		__offs += __cnt;                        \
+	    }                                           \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -1116,54 +1116,54 @@
     int __offs = 0;                                     \
     int __cnt;                                          \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            (ret) = getc(f);                            \
-            if ((ret) < 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {       \
-                        clearerr(f);                    \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        (ret) = 0;                      \
-                        break;                          \
-                    }                                   \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-                break;                                  \
-            }                                           \
-            (buf)[__ooffs+__offs] = (ret);              \
-            DEBUGBUFFER(buf);                           \
-            __offs++;                                   \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    (ret) = getc(f);                            \
+	    if ((ret) < 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {       \
+			clearerr(f);                    \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			(ret) = 0;                      \
+			break;                          \
+		    }                                   \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    (buf)[__ooffs+__offs] = (ret);              \
+	    DEBUGBUFFER(buf);                           \
+	    __offs++;                                   \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int fd = fileno(f);                             \
-                                                        \
-        while (__offs < (cnt)) {                        \
-            OBJ rA = __INST(readAhead);                 \
-            if (rA != nil) {                            \
-                (buf)[__ooffs+__offs] = __intVal(rA);   \
-                DEBUGBUFFER(buf);                       \
-                __INST(readAhead) = nil;                \
-                __offs++;                               \
-                continue;                               \
-            }                                           \
-            CLEAR_ERRNO;                                \
-            __cnt = read(fd, (buf)+__ooffs+__offs, (cnt)-__offs); \
-            DEBUGBUFFER(buf);                           \
-            if (__cnt > 0) {                            \
-                __offs += __cnt;                        \
-            }                                           \
-            break;                                      \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int fd = fileno(f);                             \
+							\
+	while (__offs < (cnt)) {                        \
+	    OBJ rA = __INST(readAhead);                 \
+	    if (rA != nil) {                            \
+		(buf)[__ooffs+__offs] = __intVal(rA);   \
+		DEBUGBUFFER(buf);                       \
+		__INST(readAhead) = nil;                \
+		__offs++;                               \
+		continue;                               \
+	    }                                           \
+	    CLEAR_ERRNO;                                \
+	    __cnt = read(fd, (buf)+__ooffs+__offs, (cnt)-__offs); \
+	    DEBUGBUFFER(buf);                           \
+	    if (__cnt > 0) {                            \
+		__offs += __cnt;                        \
+	    }                                           \
+	    break;                                      \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 
@@ -1172,40 +1172,40 @@
 
 # ifdef NO_STDIO
 #  define __WRITEBYTE__(ret, f, buf, isBuffered, handleType)          \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            (ret) = WRITE(f, buf, 1, handleType);                   \
-            if ((ret) >= 0 || __threadErrno != EINTR)           \
-                break;                                  \
-            __HANDLE_INTERRUPTS__;                      \
-        }
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    (ret) = WRITE(f, buf, 1, handleType);                   \
+	    if ((ret) >= 0 || __threadErrno != EINTR)           \
+		break;                                  \
+	    __HANDLE_INTERRUPTS__;                      \
+	}
 # else /* use STDIO */
 #  define __WRITEBYTE__(ret, f, buf, isBuffered, handleType)        \
     if (isBuffered) {                                   \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            ret = putc(*(buf), f);                      \
-            if ((ret) >= 0) {                           \
-                (ret) = 1;                              \
-            } else if (ferror(f)) {                     \
-                /* SOLARIS/SPARC (2.6) generates spurious errors with errno = 0 */ \
-                if (__threadErrno == EINTR || __threadErrno == 0) {     \
-                    __HANDLE_INTERRUPTS__;              \
-                    clearerr(f);                        \
-                    continue;                           \
-                }                                       \
-            } else                                      \
-                (ret) = 0;                              \
-            break;                                      \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    ret = putc(*(buf), f);                      \
+	    if ((ret) >= 0) {                           \
+		(ret) = 1;                              \
+	    } else if (ferror(f)) {                     \
+		/* SOLARIS/SPARC (2.6) generates spurious errors with errno = 0 */ \
+		if (__threadErrno == EINTR || __threadErrno == 0) {     \
+		    __HANDLE_INTERRUPTS__;              \
+		    clearerr(f);                        \
+		    continue;                           \
+		}                                       \
+	    } else                                      \
+		(ret) = 0;                              \
+	    break;                                      \
+	}                                               \
     } else {                                            \
-        for (;;) {                                      \
-            CLEAR_ERRNO;                                \
-            (ret) = write(fileno(f), buf, 1);           \
-            if ((ret) >= 0 || __threadErrno != EINTR)           \
-                break;                                  \
-            __HANDLE_INTERRUPTS__;                      \
-        }                                               \
+	for (;;) {                                      \
+	    CLEAR_ERRNO;                                \
+	    (ret) = write(fileno(f), buf, 1);           \
+	    if ((ret) >= 0 || __threadErrno != EINTR)           \
+		break;                                  \
+	    __HANDLE_INTERRUPTS__;                      \
+	}                                               \
    }
 # endif /* use STDIO */
 
@@ -1217,62 +1217,62 @@
 #  define __WRITEBYTES__(ret, f, buf, cnt, isBuffered, handleType)    \
     (ret) = 0;                                          \
     {                                                   \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = WRITE(f, (buf)+__offs, (cnt)-__offs, handleType); \
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR) {        \
-                    __HANDLE_INTERRUPTS__;              \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = WRITE(f, (buf)+__offs, (cnt)-__offs, handleType); \
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR) {        \
+		    __HANDLE_INTERRUPTS__;              \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 # else /* use STDIO */
 #  define __WRITEBYTES__(ret, f, buf, cnt, isBuffered, handleType)    \
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = fwrite((buf)+__offs, 1, (cnt)-__offs, f);\
-            if ((ret) <= 0) {                            \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {               \
-                        __HANDLE_INTERRUPTS__;          \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = fwrite((buf)+__offs, 1, (cnt)-__offs, f);\
+	    if ((ret) <= 0) {                            \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {               \
+			__HANDLE_INTERRUPTS__;          \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        int __offs = 0;                                 \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = write(fileno(f), (buf)+__offs, (cnt)-__offs);\
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR) {        \
-                    __HANDLE_INTERRUPTS__;              \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	int __offs = 0;                                 \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = write(fileno(f), (buf)+__offs, (cnt)-__offs);\
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR) {        \
+		    __HANDLE_INTERRUPTS__;              \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
    }
 # endif /* use STDIO */
 
@@ -1286,25 +1286,25 @@
     int __ooffs = obj_offs;                             \
     int __offs = 0;                                     \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     {                                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = WRITE(f, (buf)+__ooffs+__offs, (cnt)-__offs, handleType); \
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR) { \
-                    __HANDLE_INTERRUPTS__;              \
-                    /* refetch */                       \
-                    buf = (volatile char *)(obj);       \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = WRITE(f, (buf)+__ooffs+__offs, (cnt)-__offs, handleType); \
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR) { \
+		    __HANDLE_INTERRUPTS__;              \
+		    /* refetch */                       \
+		    buf = (volatile char *)(obj);       \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 # else /* use STDIO */
@@ -1313,47 +1313,47 @@
     int __ooffs = obj_offs;                             \
     int __offs = 0;                                     \
     char *buf = (char *)(obj);                          \
-                                                        \
+							\
     (ret) = 0;                                          \
     if (isBuffered) {                                   \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = fwrite((buf)+__ooffs+__offs, 1, (cnt)-__offs, f);           \
-            if ((ret) <= 0) {                           \
-                if (ferror(f)) {                        \
-                    if (__threadErrno == EINTR) {       \
-                        __HANDLE_INTERRUPTS__;          \
-                        /* refetch */                   \
-                        buf = (volatile char *)(obj);   \
-                        clearerr(f);                    \
-                        continue;                       \
-                    }                                   \
-                    break;                              \
-                } else {                                \
-                    (ret) = 0;                          \
-                }                                       \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = fwrite((buf)+__ooffs+__offs, 1, (cnt)-__offs, f);           \
+	    if ((ret) <= 0) {                           \
+		if (ferror(f)) {                        \
+		    if (__threadErrno == EINTR) {       \
+			__HANDLE_INTERRUPTS__;          \
+			/* refetch */                   \
+			buf = (volatile char *)(obj);   \
+			clearerr(f);                    \
+			continue;                       \
+		    }                                   \
+		    break;                              \
+		} else {                                \
+		    (ret) = 0;                          \
+		}                                       \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     } else {                                            \
-        while (__offs < (cnt)) {                        \
-            CLEAR_ERRNO;                                \
-            ret = write(fileno(f), (buf)+__ooffs+__offs, (cnt)-__offs);       \
-            if (ret <= 0) {                             \
-                if (ret < 0 && __threadErrno == EINTR){ \
-                    __HANDLE_INTERRUPTS__;              \
-                    /* refetch */                       \
-                    buf = (volatile char *)(obj);       \
-                    continue;                           \
-                }                                       \
-                break;                                  \
-            }                                           \
-            __offs += (ret);                            \
-        }                                               \
-        if (__offs > 0)                                 \
-            (ret) = __offs;                             \
+	while (__offs < (cnt)) {                        \
+	    CLEAR_ERRNO;                                \
+	    ret = write(fileno(f), (buf)+__ooffs+__offs, (cnt)-__offs);       \
+	    if (ret <= 0) {                             \
+		if (ret < 0 && __threadErrno == EINTR){ \
+		    __HANDLE_INTERRUPTS__;              \
+		    /* refetch */                       \
+		    buf = (volatile char *)(obj);       \
+		    continue;                           \
+		}                                       \
+		break;                                  \
+	    }                                           \
+	    __offs += (ret);                            \
+	}                                               \
+	if (__offs > 0)                                 \
+	    (ret) = __offs;                             \
     }                                                   \
   }
 # endif /* use STDIO */
@@ -5706,19 +5706,15 @@
 !ExternalStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.348 2012/01/14 19:05:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.349 2012/03/26 17:02:56 cg Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.348 2012/01/14 19:05:12 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.349 2012/03/26 17:02:56 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: ExternalStream.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: ExternalStream.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 ExternalStream initialize!
-
-
-
-
--- a/FileStream.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/FileStream.st	Fri Apr 13 14:18:13 2012 +0100
@@ -995,7 +995,7 @@
     "Modified: 30.7.1997 / 16:43:50 / cg"
 ! !
 
-!FileStream protectedMethodsFor:'private'!
+!FileStream methodsFor:'private'!
 
 closeFile
     "low level close - may be redefined in subclasses.
@@ -1007,9 +1007,7 @@
     ]
 
     "Created: / 13.8.1998 / 12:11:22 / cg"
-! !
-
-!FileStream methodsFor:'private'!
+!
 
 createForReadWrite
     "create/truncate the file for read/write.
@@ -1676,6 +1674,12 @@
     ^ OperatingSystem isDirectory:pathName
 !
 
+isEmpty
+    "common stream protocol: are there no bytes in the file?"
+
+    ^ self fileSize == 0.
+!
+
 size
     "common stream protocol: return the size of the stream;
      thats the number of bytes of the file."
@@ -1705,18 +1709,15 @@
 !FileStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.145 2011/10/07 13:57:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.146 2012/04/05 09:59:44 stefan Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.145 2011/10/07 13:57:55 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/FileStream.st,v 1.146 2012/04/05 09:59:44 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: FileStream.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: FileStream.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 FileStream initialize!
-
-
-
--- a/Filename.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Filename.st	Fri Apr 13 14:18:13 2012 +0100
@@ -3809,7 +3809,7 @@
 
 , aString
     "this allows filenames to understand how names are concatenated.
-     Returns a string consisting of the receivers name, concatenated
+     Returns a string consisting of the receiver's name, concatenated
      by aString. Notice this is NOT the same as construct:, which inserts
      a directory delimiter and returns a new fileName instance.
      See also: #withSuffix: which is new and better."
@@ -3826,7 +3826,8 @@
      'Makefile' asFilename construct:'.bak'     
     "
 
-    "Modified: 7.9.1997 / 23:45:36 / cg"
+    "Modified: / 07-09-1997 / 23:45:36 / cg"
+    "Modified (comment): / 01-04-2012 / 13:18:21 / cg"
 !
 
 canonicalize
@@ -5879,20 +5880,15 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.373 2012/01/19 16:20:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.374 2012/04/01 11:25:33 cg Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/Filename.st,v 1.373 2012/01/19 16:20:58 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/Filename.st,v 1.374 2012/04/01 11:25:33 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: Filename.st 10763 2012-01-22 23:07:15Z vranyj1 $'
+    ^ '$Id: Filename.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Filename initialize!
-
-
-
-
-
--- a/GenericException.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/GenericException.st	Fri Apr 13 14:18:13 2012 +0100
@@ -199,7 +199,6 @@
     "Modified: / 24.7.1999 / 13:21:25 / stefan"
 ! !
 
-
 !GenericException class methodsFor:'Compatibility-Dolphin'!
 
 signal:messageText
@@ -434,7 +433,7 @@
 handlerContextForException:anException in:aContext
     "return a handlerContext for anException in the
      contextChain starting with aContext. 
-     Returns nil ,if there is no handler."
+     Returns nil, if there is no handler."
 
     |theContext ex1 con1|
 
@@ -1097,7 +1096,6 @@
     "Modified: / 23.7.1999 / 14:50:11 / stefan"
 ! !
 
-
 !GenericException methodsFor:'Compatibility-ANSI'!
 
 pass
@@ -2304,18 +2302,15 @@
 !GenericException class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.131 2011/10/27 22:28:12 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.132 2012/04/03 18:34:13 stefan Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.131 2011/10/27 22:28:12 stefan Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.132 2012/04/03 18:34:13 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: GenericException.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: GenericException.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 GenericException initialize!
-
-
-
--- a/Integer.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Integer.st	Fri Apr 13 14:18:13 2012 +0100
@@ -2957,6 +2957,30 @@
     "Modified: / 25.10.1997 / 16:08:45 / cg"
 !
 
+integerLog2
+    "return the floor of log2 of the receiver"
+
+    self <= 0 ifTrue:[
+        ^ self class
+            raise:#domainErrorSignal
+            receiver:self
+            selector:#intlog10
+            arguments:#()
+            errorString:'logarithm of negative integer'
+    ].
+    ^ self highBit - 1.
+
+    "
+      100 integerLog2
+      100 log:2
+      999 integerLog2
+      999 log:2
+      120000 integerLog2
+      120000 log:2
+      -1 integerLog2
+    "
+!
+
 integerReciprocal
     "return an integer representing 1/self * 2**n.
      Where an integer is one bit longer than self.
@@ -4788,15 +4812,15 @@
 !Integer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.262 2012/03/05 13:38:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.264 2012/04/11 19:30:38 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Integer.st,v 1.262 2012/03/05 13:38:14 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Integer.st,v 1.264 2012/04/11 19:30:38 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Integer.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: Integer.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Integer initialize!
--- a/Method.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Method.st	Fri Apr 13 14:18:13 2012 +0100
@@ -2233,7 +2233,7 @@
 sourceStreamUsingCache:usingCacheBoolean
     "return an open sourceStream (needs positioning).
      If usingCacheBoolean is true, cache the stream (but take care against concurrent access).
-     You have to close the stream, if usingCacheBoolean is false, ans should not close it
+     You have to close the stream, if usingCacheBoolean is false, and should not close it
      if usingCacheBoolean is true."
 
     |rawStream|
@@ -2242,6 +2242,7 @@
     rawStream isNil ifTrue:[
         ^ nil.
     ].
+    rawStream position:0.
 
     "/ see if its utf8 encoded...
     ^ EncodedStream decodedStreamFor:rawStream.
@@ -3630,15 +3631,15 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.382 2012/03/06 14:47:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.383 2012/04/04 13:57:45 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Method.st,v 1.382 2012/03/06 14:47:11 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Method.st,v 1.383 2012/04/04 13:57:45 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Method.st 10796 2012-03-29 14:24:59Z vranyj1 $'
+    ^ '$Id: Method.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Method initialize!
--- a/NameSpace.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/NameSpace.st	Fri Apr 13 14:18:13 2012 +0100
@@ -139,7 +139,7 @@
 name:aStringOrSymbol
     "create a new nameSpace, named aStringOrSymbol.
      Notice, that the nameSpace is created in the current one -
-     dont get confused; we recommend, not to nest them too much."
+     don't get confused; we recommend, not to nest them too much."
 
     |currentNameSpace newNameSpace existing ok nameSym fullName|
 
@@ -196,8 +196,9 @@
      NameSpace name:'another::invalidName'
     "
 
-    "Modified: / 14.9.1997 / 09:46:59 / cg"
-    "Modified: / 18.3.1999 / 18:24:13 / stefan"
+    "Modified: / 14-09-1997 / 09:46:59 / cg"
+    "Modified: / 18-03-1999 / 18:24:13 / stefan"
+    "Modified (comment): / 23-03-2012 / 11:49:00 / cg"
 !
 
 new
@@ -720,9 +721,9 @@
 !NameSpace class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/NameSpace.st,v 1.72 2011/11/18 16:06:06 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/NameSpace.st,v 1.73 2012/03/23 10:56:21 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: NameSpace.st 10771 2012-02-06 20:14:43Z vranyj1 $'
+    ^ '$Id: NameSpace.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
--- a/Object.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Object.st	Fri Apr 13 14:18:13 2012 +0100
@@ -7188,7 +7188,8 @@
 
     "
      Point new byteSize
-     'hello' byteSize
+     'hello' byteSize      
+     'hello' asUnicode16String byteSize      
      (ByteArray with:1 with:2) byteSize
      (FloatArray with:1.5) byteSize
      (DoubleArray with:1.5) byteSize
@@ -8495,6 +8496,10 @@
     "Created: / 22-12-2010 / 17:20:36 / cg"
 !
 
+isExternalBytes
+    ^ false
+!
+
 isExternalLibraryFunction
     "return true, if the receiver is some kind of externalLibrary function;
      false is returned here - the method is only redefined in ExternalLibraryFunction."
@@ -9475,15 +9480,15 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.687 2012/03/08 15:21:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.689 2012/04/03 11:42:10 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Object.st,v 1.687 2012/03/08 15:21:22 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Object.st,v 1.689 2012/04/03 11:42:10 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Object.st 10796 2012-03-29 14:24:59Z vranyj1 $'
+    ^ '$Id: Object.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Object initialize!
--- a/ObjectMemory.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/ObjectMemory.st	Fri Apr 13 14:18:13 2012 +0100
@@ -1679,7 +1679,7 @@
 	      it may be removed (or replaced by a noop) without notice"
 
 %{
-    __dumpObject__(someObject);
+    __dumpObject__(someObject, __LINE__);
 %}
     "
      ObjectMemory dumpObject:true
@@ -4555,7 +4555,7 @@
 
     filled = __stx_malloc_stats(statsArray, sizeof(statsArray));
     if (filled < 1) {
-        RETURN(__mkSmallInteger(0));
+	RETURN(__mkSmallInteger(0));
     }
     RETURN ( __MKUINT(statsArray[0]));
 %}
@@ -4577,12 +4577,12 @@
 
     filled = __stx_malloc_stats(statsArray, sizeof(statsArray));
     if (filled < 1) {
-        RETURN(nil);
+	RETURN(nil);
     }
     allStats = __ARRAY_NEW_INT(filled);
     for (i = 0; i < filled; i++) {
-        __arrayVal(allStats)[i] = temp = __MKUINT(statsArray[i]);
-        __STORE(allStats, temp);
+	__arrayVal(allStats)[i] = temp = __MKUINT(statsArray[i]);
+	__STORE(allStats, temp);
     }
 
     RETURN ( allStats );
@@ -4602,7 +4602,7 @@
 
     filled = __stx_malloc_stats(statsArray, sizeof(statsArray));
     if (filled < 2) {
-        RETURN(__mkSmallInteger(0));
+	RETURN(__mkSmallInteger(0));
     }
     RETURN ( __MKUINT(statsArray[1]));
 %}
@@ -5589,11 +5589,11 @@
 !ObjectMemory class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.259 2012/01/18 11:10:55 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.260 2012/03/26 17:02:56 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: ObjectMemory.st 10758 2012-01-19 10:06:02Z vranyj1 $'
+    ^ '$Id: ObjectMemory.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 ObjectMemory initialize!
--- a/OrderedCollection.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/OrderedCollection.st	Fri Apr 13 14:18:13 2012 +0100
@@ -1063,17 +1063,16 @@
 !OrderedCollection methodsFor:'copying'!
 
 , aCollection
-    "return a new collection formed from concatenating the receiver with
-     the argument"
+    "return a new collection formed from concatenating the receiver with the argument"
 
     |newCollection|
 
     newCollection := self copyEmpty:(self size + aCollection size).
     self do:[:element |
-	newCollection add:element
+        newCollection add:element
     ].
     aCollection do:[:element |
-	newCollection add:element
+        newCollection add:element
     ].
     ^ newCollection
 
@@ -1081,6 +1080,8 @@
      #(1 2 3) asOrderedCollection , #(4 5 6) asOrderedCollection
      #(1 2 3) asSortedCollection , #(99 101 100) asSortedCollection
     "
+
+    "Modified (comment): / 01-04-2012 / 13:17:30 / cg"
 !
 
 copy
@@ -1956,11 +1957,11 @@
 !OrderedCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.99 2009/09/28 13:25:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.100 2012/04/01 11:24:38 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: OrderedCollection.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: OrderedCollection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 
--- a/SequenceableCollection.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/SequenceableCollection.st	Fri Apr 13 14:18:13 2012 +0100
@@ -3118,10 +3118,10 @@
 !
 
 , aCollection
-    "return a new collection formed from concatenating the receiver with
-     the argument. The class of the new collection is determined by the
-     receivers class, so mixing classes is possible, if the second collections
-     elements can be stored into instances of the receivers class."
+    "return a new collection formed from concatenating the receiver with the argument. 
+     The class of the new collection is determined by the
+     receiver's class, so mixing classes is possible, if the second collection's
+     elements can be stored into instances of the receiver's class."
 
     |newCollection
      mySize    "{ Class: SmallInteger }"
@@ -3138,18 +3138,18 @@
     newCollection replaceFrom:1 to:mySize with:self startingAt:1.
     dstIndex := mySize + 1.
     aCollection isSequenceable ifTrue:[
-	"
-	 yes, aCollection has indexed elements
-	"
-	newCollection replaceFrom:dstIndex to:newSize with:aCollection startingAt:1.
+        "
+         yes, aCollection has indexed elements
+        "
+        newCollection replaceFrom:dstIndex to:newSize with:aCollection startingAt:1.
     ] ifFalse:[
-	"
-	 no, enumerate aCollection
-	"
-	aCollection do:[:element |
-	    newCollection at:dstIndex put:element.
-	    dstIndex := dstIndex + 1
-	]
+        "
+         no, enumerate aCollection
+        "
+        aCollection do:[:element |
+            newCollection at:dstIndex put:element.
+            dstIndex := dstIndex + 1
+        ]
     ].
     ^ newCollection
 
@@ -3161,6 +3161,8 @@
      'abc' , #(1 2 3 4 5)"  "-- will fail, since strings cannot store integers
      'abc' asArray , #(1 2 3 4 5)
     "
+
+    "Modified (comment): / 01-04-2012 / 13:17:56 / cg"
 !
 
 copyButFirst:count
@@ -5476,50 +5478,111 @@
 
 !SequenceableCollection methodsFor:'private-sorting helpers'!
 
-mergeFirst: first middle: middle last: last into: dst by: aBlock
+mergeFirst:first middle:middle last:last into:dst by:aBlock 
     "Private!!
      Merge the sorted ranges [first..middle] and [middle+1..last] of the receiver into the range [first..last] of dst."
-
-    | i1 i2 val1 val2 out |
+    
+    |i1 i2 val1 val2 out|
 
     i1 := first.
+    out := first.
     i2 := middle + 1.
-    val1 := self at: i1.
-    val2 := self at: i2.
-    out := first - 1.  "will be pre-incremented"
-
-    "select 'lower' half of the elements based on comparator"
-    [(i1 <= middle) and: [i2 <= last]] whileTrue: [
-	    (aBlock value: val1 value: val2)
-		    ifTrue: [
-			    dst at: (out := out + 1) put: val1.
-			    val1 := self at: (i1 := i1 + 1)]
-		    ifFalse: [
-			    dst at: (out := out + 1) put: val2.
-			    i2 := i2 + 1.
-			    i2 <= last ifTrue: [val2 := self at: i2]]].
+    val1 := self at:i1.
+
+    i2 <= last ifTrue:[
+        val2 := self at:i2.
+        "select 'lower' half of the elements based on comparator"
+        [(i1 <= middle) and:[i2 <= last]] whileTrue:[
+            "this is stable if #< or #> ist used for comparison (and not #<= or #>=)"
+            (aBlock value:val2 value:val1) ifTrue:[
+                dst at:out put:val2.
+                i2 := i2 + 1.
+                i2 <= last ifTrue:[
+                    val2 := self at:i2
+                ]
+            ] ifFalse:[
+                dst at:out put:val1.
+                i1 := i1 + 1.
+                val1 := self at:i1.
+            ].
+            out := out + 1.
+        ].
+    ].
 
     "copy the remaining elements"
-    i1 <= middle
-	    ifTrue: [
-		    dst replaceFrom: out + 1 to: last with: self startingAt: i1]
-	    ifFalse: [
-		    dst replaceFrom: out + 1 to: last with: self startingAt: i2].
-
-!
-
-mergeSortFrom: first to: last src: src dst: dst by: aBlock
+    i1 <= middle ifTrue:[
+        dst 
+            replaceFrom:out
+            to:last
+            with:self
+            startingAt:i1
+    ] ifFalse:[
+        dst 
+            replaceFrom:out
+            to:last
+            with:self
+            startingAt:i2
+    ].
+!
+
+mergeSortFrom: first to: last by: aBlock
     "Private!! Split the range to be sorted in half, sort each half, and merge the two half-ranges into dst."
 
-    | middle |
-
-    first = last ifTrue: [^ self].
-    middle := (first + last) // 2.
-    self mergeSortFrom: first to: middle src: dst dst: src by: aBlock.
-    self mergeSortFrom: middle + 1 to: last src: dst dst: src by: aBlock.
-    src mergeFirst: first middle: middle last: last into: dst by: aBlock.
-
-
+    |size chunkSize idx nextIdx finished temp src dst|
+
+    size := last-first + 1.
+    size <= 1 ifTrue:[^ self].
+
+    "size of the base chunks"
+    chunkSize := 12.
+    idx := first.
+    finished := false.
+    [finished] whileFalse:[
+        nextIdx := idx + chunkSize.
+        nextIdx > last ifTrue:[
+            nextIdx := last+1.
+            finished := true.
+        ].
+        self insertionSort:aBlock from:idx to:nextIdx-1.
+        idx := nextIdx.
+    ].
+
+    chunkSize < size ifTrue:[
+        "now merge the chunks"
+        dst := Array new:self size.
+        src := self.
+
+        [chunkSize < size] whileTrue:[
+            "merge pairs of adjecant chunks"
+            idx := first.
+            finished := false.
+            [finished] whileFalse:[
+                nextIdx := idx + (2*chunkSize).
+                nextIdx > last ifTrue:[
+                    nextIdx := last+1.
+                    finished := true.
+                ].
+                src
+                    mergeFirst:idx 
+                    middle:idx+chunkSize-1 
+                    last:nextIdx-1 
+                    into:dst
+                    by:aBlock.
+                idx := nextIdx.
+            ].
+
+            chunkSize := chunkSize * 2.
+
+            "merged chunks are in dst. Swap source and destination for next step"
+            temp := dst.
+            dst := src.
+            src := temp.
+        ].
+        "note, the latest dst is now src (see above)"
+        src ~~ self ifTrue:[
+            self replaceFrom:first to:last with:src startingAt:first.
+        ].
+    ].
 !
 
 quickSortFrom:inBegin to:inEnd
@@ -5527,325 +5590,504 @@
      Simulates recursion in a stack, to avoid recursion overflow
      with degenerated collections.
 
+     The algorithm has been extended to introSort, which is quickSort with fallBack
+     when we find out, that we have a worst case quick sort with O(n*n).
+
+     Use #< for element comparisons, since this is the (fastest) base
+     method in Magnitude, and the others may be defined by sending #<."
+
+    |begin   "{ Class: SmallInteger }"
+     end     "{ Class: SmallInteger }"
+     bRun    "{ Class: SmallInteger }"
+     eRun    "{ Class: SmallInteger }"
+     m       "{ Class: SmallInteger }"
+     prevIdx "{ Class: SmallInteger }"
+     elB elM elE temp stack depthLimit|
+
+    inEnd <= inBegin ifTrue:[
+        "nothing to sort"
+        ^ self.
+    ].
+
+    depthLimit := (inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:(2 * depthLimit).
+    stack add:inBegin; add:inEnd.
+    depthLimit := depthLimit - 1.
+
+    [stack notEmpty] whileTrue:[
+        depthLimit := depthLimit+1.
+        end := stack removeLast.
+        begin := stack removeLast.
+
+        end - begin <= 12 ifTrue:[
+            "for small number of elements do an insertion sort, which is faster"
+            bRun := begin + 1.
+            bRun to:end do:[:idx|
+                temp := self at:idx.
+                prevIdx := idx-1.
+                [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
+                    self at:prevIdx+1 put:(self at:prevIdx).
+                    prevIdx := prevIdx - 1.
+                ].
+                (prevIdx+1) ~~ idx ifTrue:[
+                    self at:prevIdx+1 put:temp.
+                ].
+            ].
+        ] ifFalse:[
+           depthLimit <= 0 ifTrue:[
+               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
+               ^ self mergeSort:[:a :b | a < b] from:inBegin to:inEnd.
+           ].
+           elB := self at:begin.
+           elE := self at:end.
+           m := (begin + end) // 2.
+           elM := self at:m.
+           "take the median of three as pivot (elM)"
+           (elM < elB) ifTrue:[
+               temp := self at:begin put:elM.
+               elM := self at:m put:elB.
+               elB := temp.
+           ].
+           (elE < elB) ifTrue:[
+               self at:begin put:elE.
+               elE := self at:end put:elB.
+           ].
+           (elE < elM) ifTrue:[
+               self at:end put:elM.
+               elM := self at:m put:elE.
+           ].
+
+           bRun := begin.
+           eRun := end.
+           "use simple expressions without additional statements in whileXXX: conditions,
+            so STC can optimize"
+           [bRun < eRun] whileTrue:[
+                [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
+                [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
+
+                (bRun < eRun) ifTrue:[
+                    temp := self at:bRun.
+                    self at:bRun put:(self at:eRun). 
+                    self at:eRun put:temp.
+                ].
+            ].
+            (begin < eRun) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:begin; add:eRun.
+            ].
+            (bRun < end) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:bRun; add:end.
+            ].
+        ].
+    ]
+!
+
+quickSortFrom:inBegin to:inEnd sortBlock:sortBlock
+    "actual quicksort worker for sort-message.
+     Simulates recursion in a stack, to avoid recursion overflow
+     with degenerated collections.
+
+     The algorithm has been extended to introSort, which is quickSort with fallBack
+     when we find out, that we have a worst case quick sort with O(n*n).
+
+     Use sortBlock for element comparisons."
+
+    |begin   "{ Class: SmallInteger }"
+     end     "{ Class: SmallInteger }"
+     bRun    "{ Class: SmallInteger }"
+     eRun    "{ Class: SmallInteger }"
+     m       "{ Class: SmallInteger }"
+     prevIdx "{ Class: SmallInteger }"
+     elB elM elE temp stack depthLimit|
+
+    inEnd <= inBegin ifTrue:[
+        "nothing to sort"
+        ^ self.
+    ].
+
+    depthLimit := (inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:(2 * depthLimit).
+    stack add:inBegin; add:inEnd.
+    depthLimit := depthLimit - 1.
+
+    [stack notEmpty] whileTrue:[
+        depthLimit := depthLimit+1.
+        end := stack removeLast.
+        begin := stack removeLast.
+
+        end - begin < 12 ifTrue:[
+            "for small number of elements do an insertion sort, which is faster"
+            bRun := begin + 1.
+            bRun to:end do:[:idx|
+                temp := self at:idx.
+                prevIdx := idx-1.
+                [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
+                    self at:prevIdx+1 put:(self at:prevIdx).
+                    prevIdx := prevIdx - 1.
+                ].
+                (prevIdx+1) ~~ idx ifTrue:[
+                    self at:prevIdx+1 put:temp.
+                ].
+            ].
+        ] ifFalse:[
+           depthLimit <= 0 ifTrue:[
+               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
+               ^ self mergeSort:sortBlock from:inBegin to:inEnd.
+           ].
+           elB := self at:begin.
+           elE := self at:end.
+           m := (begin + end) // 2.
+           elM := self at:m.
+           "take the median of three as pivot (elM)"
+           (sortBlock value:elM value:elB) ifTrue:[
+               temp := self at:begin put:elM.
+               elM := self at:m put:elB.
+               elB := temp.
+           ].
+           (sortBlock value:elE value:elB) ifTrue:[
+               self at:begin put:elE.
+               elE := self at:end put:elB.
+           ].
+           (sortBlock value:elE value:elM) ifTrue:[
+               self at:end put:elM.
+               elM := self at:m put:elE.
+           ].
+
+           bRun := begin.
+           eRun := end.
+           "use simple expressions without additional statements in whileXXX: conditions,
+            so STC can optimize"
+           [bRun < eRun] whileTrue:[
+                [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
+                [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
+
+                (bRun < eRun) ifTrue:[
+                    temp := self at:bRun.
+                    self at:bRun put:(self at:eRun). 
+                    self at:eRun put:temp.
+                ].
+            ].
+            (begin < eRun) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:begin; add:eRun.
+            ].
+            (bRun < end) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:bRun; add:end.
+            ].
+        ].
+    ]
+!
+
+quickSortFrom:inBegin to:inEnd sortBlock:sortBlock policy:policy
+    "actual quicksort worker for sort-message.
+     Simulates recursion in a stack, to avoid recursion overflow
+     with degenerated collections.
+
+     Use sortBlock for element comparisons."
+
+    |begin   "{ Class: SmallInteger }"
+     end     "{ Class: SmallInteger }"
+     bRun    "{ Class: SmallInteger }"
+     eRun    "{ Class: SmallInteger }"
+     m       "{ Class: SmallInteger }"
+     prevIdx "{ Class: SmallInteger }"
+     elB elM elE temp stack depthLimit|
+
+    inEnd <= inBegin ifTrue:[
+        "nothing to sort"
+        ^ self.
+    ].
+
+    depthLimit := (inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:(2 * depthLimit).
+    stack add:inBegin; add:inEnd.
+    depthLimit := depthLimit - 1.
+
+    [stack notEmpty] whileTrue:[
+        depthLimit := depthLimit+1.
+        end := stack removeLast.
+        begin := stack removeLast.
+
+        end - begin < 12 ifTrue:[
+            "for small number of elements do an insertion sort, which is faster"
+            bRun := begin + 1.
+            bRun to:end do:[:idx|
+                temp := self at:idx.
+                prevIdx := idx-1.
+                [prevIdx >= begin and:[sortBlock value:policy value:temp value:(self at:prevIdx)]] whileTrue:[
+                    self at:prevIdx+1 put:(self at:prevIdx).
+                    prevIdx := prevIdx - 1.
+                ].
+                (prevIdx+1) ~~ idx ifTrue:[
+                    self at:prevIdx+1 put:temp.
+                ].
+            ].
+        ] ifFalse:[
+"/ mergeSort does not handle policy yet
+"/           depthLimit <= 0 ifTrue:[
+"/               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
+"/               ^ self mergeSort:sortBlock from:inBegin to:inEnd.
+"/           ].
+           elB := self at:begin.
+           elE := self at:end.
+           m := (begin + end) // 2.
+           elM := self at:m.
+           "take the median of three as pivot (elM)"
+           (sortBlock value:policy value:elM value:elB) ifTrue:[
+               temp := self at:begin put:elM.
+               elM := self at:m put:elB.
+               elB := temp.
+           ].
+           (sortBlock value:policy value:elE value:elB) ifTrue:[
+               self at:begin put:elE.
+               elE := self at:end put:elB.
+           ].
+           (sortBlock value:policy value:elE value:elM) ifTrue:[
+               self at:end put:elM.
+               elM := self at:m put:elE.
+           ].
+
+           bRun := begin.
+           eRun := end.
+           "use simple expressions without additional statements in whileXXX: conditions,
+            so STC can optimize"
+           [bRun < eRun] whileTrue:[
+                [(bRun := bRun+1) <= eRun and:[sortBlock value:policy value:(self at:bRun) value:elM]] whileTrue.
+                [bRun <= (eRun := eRun-1) and:[sortBlock value:policy value:elM value:(self at:eRun)]] whileTrue.
+
+                (bRun < eRun) ifTrue:[
+                    temp := self at:bRun.
+                    self at:bRun put:(self at:eRun). 
+                    self at:eRun put:temp.
+                ].
+            ].
+            (begin < eRun) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:begin; add:eRun.
+            ].
+            (bRun < end) ifTrue:[
+                depthLimit := depthLimit-1.
+                stack add:bRun; add:end.
+            ].
+        ].
+    ]
+!
+
+quickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
+    "actual quicksort worker for sort-message.
+     Simulates recursion in a stack, to avoid recursion overflow
+     with degenerated collections.
+
+     Use sortBlock for element comparisons."
+
+    |begin   "{ Class: SmallInteger }"
+     end     "{ Class: SmallInteger }"
+     bRun    "{ Class: SmallInteger }"
+     eRun    "{ Class: SmallInteger }"
+     m       "{ Class: SmallInteger }"
+     prevIdx "{ Class: SmallInteger }"
+     elB elM elE temp temp1 stack depthLimit|
+
+    inEnd <= inBegin ifTrue:[
+        "nothing to sort"
+        ^ self.
+    ].
+
+    depthLimit := (inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:(2 * depthLimit).
+    stack add:inBegin; add:inEnd.
+
+    [stack notEmpty] whileTrue:[
+        end := stack removeLast.
+        begin := stack removeLast.
+
+        end - begin < 12 ifTrue:[
+            "for small number of elements do an insertion sort, which is faster"
+            bRun := begin + 1.
+            bRun to:end do:[:idx|
+                temp := self at:idx.
+                temp1 := aCollection at:idx.
+                prevIdx := idx-1.
+                [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
+                    self at:prevIdx+1 put:(self at:prevIdx).
+                    aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
+                    prevIdx := prevIdx - 1.
+                ].
+                (prevIdx+1) ~~ idx ifTrue:[
+                    self at:prevIdx+1 put:temp.
+                    aCollection at:prevIdx+1 put:temp1.
+                ].
+            ].
+        ] ifFalse:[
+           elB := self at:begin.
+           elE := self at:end.
+           m := (begin + end) // 2.
+           elM := self at:m.
+           "take the median of three as pivot (elM)"
+           (sortBlock value:elM value:elB) ifTrue:[
+               temp := self at:begin put:elM.
+               elM := self at:m put:elB.
+               elB := temp.
+
+               temp := aCollection at:begin.  
+               aCollection at:begin put:(aCollection at:m).  
+               aCollection at:m put:temp.  
+           ].
+           (sortBlock value:elE value:elB) ifTrue:[
+               self at:begin put:elE.
+               elE := self at:end put:elB.
+
+               temp := aCollection at:end.  
+               aCollection at:end put:(aCollection at:begin).  
+               aCollection at:begin put:temp. 
+           ].
+           (sortBlock value:elE value:elM) ifTrue:[
+               self at:end put:elM.
+               elM := self at:m put:elE.
+
+               temp := aCollection at:end.  
+               aCollection at:end put:(aCollection at:m).  
+               aCollection at:m put:temp.  
+           ].
+
+           bRun := begin.
+           eRun := end.
+           "use simple expressions without additional statements in whileXXX: conditions,
+            so STC can optimize"
+           [bRun < eRun] whileTrue:[
+                [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
+                [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
+
+                (bRun < eRun) ifTrue:[
+                    temp := self at:bRun.
+                    self at:bRun put:(self at:eRun). 
+                    self at:eRun put:temp.
+
+                    temp := aCollection at:bRun.
+                    aCollection at:bRun put:(aCollection at:eRun).
+                    aCollection at:eRun put:temp.
+                ].
+            ].
+            (begin < eRun) ifTrue:[
+                stack add:begin; add:eRun.
+            ].
+            (bRun < end) ifTrue:[
+                stack add:bRun; add:end.
+            ].
+        ].
+    ]
+!
+
+quickSortFrom:inBegin to:inEnd with:aCollection
+    "actual quicksort worker for sort-message.
+     Simulates recursion in a stack, to avoid recursion overflow
+     with degenerated collections.
+
      Use #< for element comparisons, since this is the (fastest) base
      method in Magnitude, and the others may be defined by sending #<."
 
     |begin   "{ Class: SmallInteger }"
      end     "{ Class: SmallInteger }"
-     b       "{ Class: SmallInteger }"
-     e       "{ Class: SmallInteger }"
-     middleElement temp1 temp2 stack |
-
-    stack := OrderedCollection new.
-    stack add:inBegin.
-    stack add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-	end := stack removeLast.
-	begin := stack removeLast.
-
-	b := begin.
-	e := end.
-	middleElement := self at:((b + e) // 2).
-
-	[b < e] whileTrue:[
-	    [b < end and:[(self at:b) < middleElement]] whileTrue:[b := b + 1].
-	    [e > begin and:[middleElement < (self at:e)]] whileTrue:[e := e - 1].
-
-	    (b <= e) ifTrue:[
-		(b == e) ifFalse:[
-		    temp1 := self at:b. temp2 := self at:e.
-		    self at:b put:temp2. self at:e put:temp1
-		].
-		b := b + 1.
-		e := e - 1
-	    ]
-	].
-	(begin < e) ifTrue:[
-	    stack add:begin.
-	    stack add:e.
-	].
-	(b < end) ifTrue:[
-	    stack add:b.
-	    stack add:end.
-	]
-    ]
-!
-
-quickSortFrom:inBegin to:inEnd sortBlock:sortBlock
-    "actual quicksort worker for sort:-message.
-     Simulates recursion in a stack, to avoid recursion overflow
-     with degenerated collections."
-
-    |begin   "{ Class: SmallInteger }"
-     end     "{ Class: SmallInteger }"
-     bRun    "{ Class: SmallInteger }"
-     eRun    "{ Class: SmallInteger }"
-     m       "{ Class: SmallInteger }"
-     nToSort "{ Class: SmallInteger }"
-     elB elM elE temp stack|
-
-    stack := OrderedCollection new.
-    stack add:inBegin.
-    stack add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-	end := stack removeLast.
-	begin := stack removeLast.
-
-	(nToSort := end + 1 - begin) > 1 ifTrue:[
-	    elB := self at:begin.
-	    elE := self at:end.
-	    (sortBlock value:elB value:elE) ifFalse:[
-		temp := elB. elB := elE. elE := temp.
-		self at:begin put:elB.
-		self at:end put:elE.
-	    ].
-
-	    nToSort > 2 ifTrue:[
-		m := (begin + end) // 2.
-		elM := self at:m.
-		(sortBlock value:elB value:elM) ifTrue:[
-		    (sortBlock value:elM value:elE) ifFalse:[
-			temp := self at:end.
-			self at:end put:(self at:m).
-			self at:m put:temp.
-			elM := elE
-		    ]
-		] ifFalse:[
-		    temp := self at:begin.
-		    self at:begin put:(self at:m).
-		    self at:m put:temp.
-		    elM := elB
-		].
-		nToSort > 3 ifTrue:[
-		     bRun := begin.
-		     eRun := end.
-		     [
-			[eRun := eRun - 1.  bRun <= eRun and:[sortBlock value:elM value: (self at:eRun)]] whileTrue.
-			[bRun := bRun + 1.  bRun <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
-			bRun <= eRun
-		     ] whileTrue:[
-			temp := self at:bRun.
-			self at:bRun put:(self at:eRun).
-			self at:eRun put:temp.
-		     ].
-		     stack add:begin.
-		     stack add:eRun.
-
-		     stack add:bRun.
-		     stack add:end.
-		]
-	    ]
-	]
-    ]
-!
-
-quickSortFrom:inBegin to:inEnd sortBlock:sortBlock policy:p
-    "actual quicksort worker for sort:-message.
-     Simulates recursion in a stack, to avoid recursion overflow
-     with degenerated collections."
-
-    |begin   "{ Class: SmallInteger }"
-     end     "{ Class: SmallInteger }"
      bRun    "{ Class: SmallInteger }"
      eRun    "{ Class: SmallInteger }"
      m       "{ Class: SmallInteger }"
-     nToSort "{ Class: SmallInteger }"
-     elB elM elE temp stack|
-
-    stack := OrderedCollection new.
-    stack add:inBegin.
-    stack add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-	end := stack removeLast.
-	begin := stack removeLast.
-
-       (nToSort := end + 1 - begin) > 1 ifTrue:[
-	    elB := self at:begin.
-	    elE := self at:end.
-	    (sortBlock value:p value:elB value:elE) ifFalse:[
-		temp := elB. elB := elE. elE := temp.
-		self at:begin put:elB.
-		self at:end put:elE.
-	    ].
-
-	    nToSort > 2 ifTrue:[
-		m := (begin + end) // 2.
-		elM := self at:m.
-		(sortBlock value:p value:elB value:elM) ifTrue:[
-		    (sortBlock value:p value:elM value:elE) ifFalse:[
-			temp := self at:end.
-			self at:end put:(self at:m).
-			self at:m put:temp.
-			elM := elE
-		    ]
-		] ifFalse:[
-		    temp := self at:begin.
-		    self at:begin put:(self at:m).
-		    self at:m put:temp.
-		    elM := elB
-		].
-		nToSort > 3 ifTrue:[
-		     bRun := begin.
-		     eRun := end.
-		     [
-			[eRun := eRun - 1.  bRun <= eRun and:[sortBlock value:p value:elM value: (self at:eRun)]] whileTrue.
-			[bRun := bRun + 1.  bRun <= eRun and:[sortBlock value:p value:(self at:bRun) value:elM]] whileTrue.
-			bRun <= eRun
-		     ] whileTrue:[
-			temp := self at:bRun.
-			self at:bRun put:(self at:eRun).
-			self at:eRun put:temp.
-		     ].
-		     stack add:begin.
-		     stack add:eRun.
-
-		     stack add:bRun.
-		     stack add:end.
-		]
-	    ]
-	]
-    ]
-!
-
-quickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
-    "actual quicksort worker for sort:-message.
-     Simulates recursion in a stack, to avoid recursion overflow
-     with degenerated collections."
-
-    |begin   "{ Class: SmallInteger }"
-     end     "{ Class: SmallInteger }"
-     bRun    "{ Class: SmallInteger }"
-     eRun    "{ Class: SmallInteger }"
-     m       "{ Class: SmallInteger }"
-     nToSort "{ Class: SmallInteger }"
-     elB elM elE temp stack|
-
-    stack := OrderedCollection new.
-    stack add:inBegin.
-    stack add:inEnd.
+     prevIdx "{ Class: SmallInteger }"
+     elB elM elE temp temp1 stack depthLimit|
+
+    inEnd <= inBegin ifTrue:[
+        "nothing to sort"
+        ^ self.
+    ].
+
+    depthLimit := (inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:(2 * depthLimit).
+    stack add:inBegin; add:inEnd.
 
     [stack notEmpty] whileTrue:[
-	end := stack removeLast.
-	begin := stack removeLast.
-
-	(nToSort := end + 1 - begin) > 1 ifTrue:[
-
-	    elB := self at:begin.
-	    elE := self at:end.
-	    (sortBlock value:elB value:elE) ifFalse:[
-		temp := elB. elB := elE. elE := temp.
-		self at:begin put:elB.
-		self at:end put:elE.
-
-		temp := aCollection at:end.
-		aCollection at:end put:(aCollection at:begin).
-		aCollection at:begin put:temp.
-	    ].
-
-	    nToSort > 2 ifTrue:[
-		m := (begin + end) // 2.
-		elM := self at:m.
-		(sortBlock value:elB value:elM) ifTrue:[
-		    (sortBlock value:elM value:elE) ifFalse:[
-			temp := self at:end.
-			self at:end put:(self at:m).
-			self at:m put:temp.
-
-			temp := aCollection at:end.
-			aCollection at:end put:(aCollection at:m).
-			aCollection at:m put:temp.
-
-			elM := elE
-		    ]
-		] ifFalse:[
-		    temp := self at:begin.
-		    self at:begin put:(self at:m).
-		    self at:m put:temp.
-
-		    temp := aCollection at:begin.
-		    aCollection at:begin put:(aCollection at:m).
-		    aCollection at:m put:temp.
-		    elM := elB
-		].
-		nToSort > 3 ifTrue:[
-		     bRun := begin.
-		     eRun := end.
-		     [
-			[eRun := eRun - 1.  bRun <= eRun and:[sortBlock value:elM value: (self at:eRun)]] whileTrue.
-			[bRun := bRun + 1.  bRun <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
-			bRun <= eRun
-		     ] whileTrue:[
-			temp := self at:bRun.
-			self at:bRun put:(self at:eRun).
-			self at:eRun put:temp.
-
-			temp := aCollection at:bRun.
-			aCollection at:bRun put:(aCollection at:eRun).
-			aCollection at:eRun put:temp.
-		     ].
-		     stack add:begin.
-		     stack add:eRun.
-
-		     stack add:bRun.
-		     stack add:end.
-		]
-	    ]
-	]
-    ]
-!
-
-quickSortFrom:inBegin to:inEnd with:aCollection
-    "actual quicksort worker for sortWith-message.
-     Simulates recursion in a stack, to avoid recursion overflow
-     with degenerated collections.
-
-     Use #< for element comparisons, since this is the (fastest) base
-     method in Magnitude, and the others may be defined by sending #<."
-
-    |begin   "{ Class: SmallInteger }"
-     end     "{ Class: SmallInteger }"
-     b       "{ Class: SmallInteger }"
-     e       "{ Class: SmallInteger }"
-     middleElement temp1 temp2 stack|
-
-    stack := OrderedCollection new.
-    stack add:inBegin.
-    stack add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-	end := stack removeLast.
-	begin := stack removeLast.
-
-	b := begin.
-	e := end.
-	middleElement := self at:((b + e) // 2).
-
-	[b < e] whileTrue:[
-	    [b < end and:[(self at:b) < middleElement]] whileTrue:[b := b + 1].
-	    [e > begin and:[middleElement < (self at:e)]] whileTrue:[e := e - 1].
-
-	    (b <= e) ifTrue:[
-		(b == e) ifFalse:[
-		    temp1 := self at:b. temp2 := self at:e.
-		    self at:b put:temp2. self at:e put:temp1.
-		    temp1 := aCollection at:b. temp2 := aCollection at:e.
-		    aCollection at:b put:temp2. aCollection at:e put:temp1
-		].
-		b := b + 1.
-		e := e - 1
-	    ]
-	].
-	(begin < e) ifTrue:[
-	    stack add:begin.
-	    stack add:e.
-	].
-	(b < end) ifTrue:[
-	    stack add:b.
-	    stack add:end.
-	]
+        end := stack removeLast.
+        begin := stack removeLast.
+
+        end - begin < 12 ifTrue:[
+            "for small number of elements do an insertion sort, which is faster"
+            bRun := begin + 1.
+            bRun to:end do:[:idx|
+                temp := self at:idx.
+                temp1 := aCollection at:idx.
+                prevIdx := idx-1.
+                [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
+                    self at:prevIdx+1 put:(self at:prevIdx).
+                    aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
+                    prevIdx := prevIdx - 1.
+                ].
+                (prevIdx+1) ~~ idx ifTrue:[
+                    self at:prevIdx+1 put:temp.
+                    aCollection at:prevIdx+1 put:temp1.
+                ].
+            ].
+        ] ifFalse:[
+           elB := self at:begin.
+           elE := self at:end.
+           m := (begin + end) // 2.
+           elM := self at:m.
+           "take the median of three as pivot (elM)"
+           (elM < elB) ifTrue:[
+               temp := self at:begin put:elM.
+               elM := self at:m put:elB.
+               elB := temp.
+
+               temp := aCollection at:begin.  
+               aCollection at:begin put:(aCollection at:m).  
+               aCollection at:m put:temp.  
+           ].
+           (elE < elB) ifTrue:[
+               self at:begin put:elE.
+               elE := self at:end put:elB.
+
+               temp := aCollection at:end.  
+               aCollection at:end put:(aCollection at:begin).  
+               aCollection at:begin put:temp. 
+           ].
+           (elE < elM) ifTrue:[
+               self at:end put:elM.
+               elM := self at:m put:elE.
+
+               temp := aCollection at:end.  
+               aCollection at:end put:(aCollection at:m).  
+               aCollection at:m put:temp.  
+           ].
+
+           bRun := begin.
+           eRun := end.
+           "use simple expressions without additional statements in whileXXX: conditions,
+            so STC can optimize"
+           [bRun < eRun] whileTrue:[
+                [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
+                [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
+
+                (bRun < eRun) ifTrue:[
+                    temp := self at:bRun.
+                    self at:bRun put:(self at:eRun). 
+                    self at:eRun put:temp.
+
+                    temp := aCollection at:bRun.
+                    aCollection at:bRun put:(aCollection at:eRun).
+                    aCollection at:eRun put:temp.
+                ].
+            ].
+            (begin < eRun) ifTrue:[
+                stack add:begin; add:eRun.
+            ].
+            (bRun < end) ifTrue:[
+                stack add:bRun; add:end.
+            ].
+        ].
     ]
 !
 
@@ -7366,14 +7608,86 @@
     "
 !
 
+insertionSort
+    "sort the collection using a insertionSort algorithm.
+     The elements are compared using'#<'
+     i.e. they should offer a magnitude-like protocol.
+
+     Insertion sort sort is a stable sorting algorithm, i.e. elements with the same sort key
+     keep their order (if you use e.g. #<) for comparison.
+
+     The implementation uses the insertionSort algorithm, 
+     which is slow for large collections O(n*n), but good for small or
+     almost sorted collections O(N).
+
+     See also #quickSort for other sort algorithms
+     with different worst- and average case behavior)"
+
+    self insertionSort:[:a :b | a < b]
+!
+
+insertionSort:sortBlock
+    |stop|
+
+    stop := self size.
+    (stop > 1) ifTrue:[
+        self insertionSort:sortBlock from:1 to:stop
+    ].
+!
+
+insertionSort:sortBlock from:inBegin to:inEnd
+    "binary insertion sort.
+     The implementation uses the insertionSort algorithm, 
+     which is slow for large collections O(n*n), but good for small or
+     almost sorted collections O(N)."
+
+    |begin      "{Class: SmallInteger}"
+     end        "{Class: SmallInteger}"
+     prevIdx    "{Class: SmallInteger}"
+     temp|
+
+    begin := inBegin+1.
+    end := inEnd.
+    begin to:end do:[:idx|
+        temp := self at:idx.
+        prevIdx := idx-1.
+        "this is stable if #< or #> ist used for comparison (and not #<= or #>=)"
+        [prevIdx >= inBegin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
+            self at:prevIdx+1 put:(self at:prevIdx).
+            prevIdx := prevIdx - 1.
+        ].
+        (prevIdx+1) ~~ idx ifTrue:[
+            self at:prevIdx+1 put:temp.
+        ].
+    ].
+
+    "
+     |data|
+     data := Random new next:1000.
+     Transcript show:'merge random  '; showCR:(Time millisecondsToRun:[data mergeSort]).
+     Transcript show:'merge sorted  '; showCR:(Time millisecondsToRun:[data mergeSort]).
+     data reverse.
+     Transcript show:'merge reverse '; showCR:(Time millisecondsToRun:[data mergeSort]).
+
+     data := Random new next:1000.
+     Transcript show:'insert random  '; showCR:(Time millisecondsToRun:[data insertionSort]).
+     Transcript show:'insert sorted  '; showCR:(Time millisecondsToRun:[data insertionSort]).
+     data reverse.
+     Transcript show:'insert reverse '; showCR:(Time millisecondsToRun:[data insertionSort]).
+    "
+!
+
 mergeSort
     "sort the collection using a mergeSort algorithm.
-     The elements are compared using'<'
+     The elements are compared using '#<'
      i.e. they should offer a magnitude-like protocol.
 
+     Merge sort is a stable sorting algorithm, i.e. elements with the same sort key
+     keep their order.
+
      The implementation uses the mergesort algorithm, which may not be
      the best possible for all situations
-     See also #quickSort and #randomizedSort for other sort algorithms
+     See also #quickSort for other sort algorithms
      with different worst- and average case behavior)"
 
     self mergeSort:[:a :b | a < b]
@@ -7382,72 +7696,76 @@
      #(1 16 7 98 3 19 4 0) mergeSort
      #(1 16 7 98 7 3 19 4 0) mergeSort 
 
-     |data|
-     data := Random new next:100000.
-     'merge random  ' print. (Time millisecondsToRun:[data mergeSort]) printNL.
-     'merge sorted  ' print. (Time millisecondsToRun:[data mergeSort]) printNL.
-     data reverse.
-     'merge reverse ' print. (Time millisecondsToRun:[data mergeSort]) printNL.
-
-     data := Random new next:100000.
-     'quick random  ' print. (Time millisecondsToRun:[data sort]) printNL.
-     'quick sorted  ' print. (Time millisecondsToRun:[data sort]) printNL.
-     data reverse.
-     'quick reverse ' print. (Time millisecondsToRun:[data sort]) printNL.
-
-     data := Random new next:100000.
-     'quickr random  ' print. (Time millisecondsToRun:[data randomizedSort]) printNL.
-     'quickr sorted  ' print. (Time millisecondsToRun:[data randomizedSort]) printNL.
-     data reverse.
-     'quickr reverse ' print. (Time millisecondsToRun:[data randomizedSort]) printNL.
+     |random data|
+
+     random := Random new next:500000.
+
+     data := random copy.
+     Transcript show:'merge random  '; showCR:(Time millisecondsToRun:[data mergeSort]).
+     Transcript show:'merge sorted  '; showCR:(Time millisecondsToRun:[data mergeSort]).
+     data := data reverse.
+     Transcript show:'merge reverse '; showCR:(Time millisecondsToRun:[data mergeSort]).
+
+     data := random copy.
+     Transcript show:'quick block random  '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a < b]]).
+     Transcript show:'quick block sorted  '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a < b]]).
+     data := data reverse.
+     Transcript show:'quick block reverse '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a < b]]).
+
+     data := random copy.
+     Transcript show:'quick random  '; showCR:(Time millisecondsToRun:[data quickSort]).
+     Transcript show:'quick sorted  '; showCR:(Time millisecondsToRun:[data quickSort]).
+     data := data reverse.
+     Transcript show:'quick reverse '; showCR:(Time millisecondsToRun:[data quickSort]).
     "
 !
 
 mergeSort:sortBlock
     "sort the collection using a mergeSort algorithm.
-     The elements are compared using'<'
+     The elements are compared using sortBlock
      i.e. they should offer a magnitude-like protocol.
 
+     Merge sort is a stable sorting algorithm, i.e. elements with the same sort key
+     keep their order (if you use e.g. #< for comparison).
+
      The implementation uses the mergesort algorithm, which may not be
      the best possible for all situations
-     See also #quickSort and #randomizedSort for other sort algorithms
+     See also #quickSort for other sort algorithms
      with different worst- and average case behavior)"
 
     |stop|
 
     stop := self size.
     (stop > 1) ifTrue:[
-	self mergeSort:sortBlock from:1 to:stop
-    ]
-
-    "
-     #(1 16 7 98 3 19 4 0) mergeSort
-
-     |data|
-     data := Random new next:200000.
-     Transcript show:'merge random  '; showCR:(Time millisecondsToRun:[data mergeSort]).
-     Transcript show:'merge sorted  '; showCR:(Time millisecondsToRun:[data mergeSort]).
-     data reverse.
-     Transcript show:'merge reverse '; showCR:(Time millisecondsToRun:[data mergeSort]).
-
-     data := Random new next:200000.
-     Transcript show:'quick random  '; showCR:(Time millisecondsToRun:[data sort]).
-     Transcript show:'quick sorted  '; showCR:(Time millisecondsToRun:[data sort]).
-     data reverse.
-     Transcript show:'quick reverse '; showCR:(Time millisecondsToRun:[data sort]).
-
-     data := Random new next:200000.
-     Transcript show:'quickr random  '; showCR:(Time millisecondsToRun:[data randomizedSort]).
-     Transcript show:'quickr sorted  '; showCR:(Time millisecondsToRun:[data randomizedSort]).
-     data reverse.
-     Transcript show:'quickr reverse '; showCR:(Time millisecondsToRun:[data randomizedSort]).
-    "
-!
-
-mergeSort:aBlock from: startIndex to: stopIndex
+        self mergeSort:sortBlock from:1 to:stop
+    ].
+
+    "
+     |random data|
+
+     random := Random new next:500000.
+
+     data := random copy.
+     Transcript show:'merge block random  '; showCR:(Time millisecondsToRun:[data mergeSort:[:a :b| a <= b]]).
+     Transcript show:'merge block sorted  '; showCR:(Time millisecondsToRun:[data mergeSort:[:a :b| a <= b]]).
+     data := data reverse.
+     Transcript show:'merge block reverse '; showCR:(Time millisecondsToRun:[data mergeSort:[:a :b| a <= b]]).
+
+     data := random copy.
+     Transcript show:'quick block random  '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a <= b]]).
+     Transcript show:'quick block sorted  '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a <= b]]).
+     data := data reverse.
+     Transcript show:'quick block reverse '; showCR:(Time millisecondsToRun:[data quickSort:[:a :b| a <= b]]).
+   "
+!
+
+mergeSort:aBlock from:startIndex to:stopIndex 
     "Sort the given range of indices using the mergesort algorithm.
      Mergesort is a worst-case O(N log N) sorting algorithm that usually does only half
-     as many comparisons as heapsort or quicksort."
+     as many comparisons as heapsort or quicksort.
+
+     Merge sort is a stable sorting algorithm, i.e. elements with the same sort key
+     keep their order (if you use e.g. #< or #> for comparison)."
 
     "Details: recursively split the range to be sorted into two halves,
      mergesort each half, then merge the two halves together.
@@ -7455,44 +7773,35 @@
      and forth between the receiver and this copy.
      The recursion is set up so that the final merge is performed into the receiver,
      resulting in the receiver being completely sorted."
-
-    | temp |
-
-    self size <= 1 ifTrue: [^ self].  "nothing to do"
-    startIndex = stopIndex ifTrue: [^ self].
-    (startIndex >= 1 and: [startIndex < stopIndex])
-	    ifFalse: [self error: 'bad start index'].
-    stopIndex <= self size
-	    ifFalse: [self error: 'bad stop index'].
-    temp := self clone.
-    self mergeSortFrom: startIndex to: stopIndex src: temp dst: self by: aBlock.
-
-    "
-     #(1 16 7 98 3 19 4 0) mergeSort
-    "
-
-    "
-     |data|
-     data := Random new next:100000.
-     Transcript show:'merge random  '; showCR:(Time millisecondsToRun:[data mergeSort]).
-     Transcript show:'merge sorted  '; showCR:(Time millisecondsToRun:[data mergeSort]).
-     data reverse.
-     Transcript show:'merge reverse '; showCR:(Time millisecondsToRun:[data mergeSort]).
-    "
-    "
-     |data|
-     data := Random new next:100000.
-     Transcript show:'quick random  '; showCR:(Time millisecondsToRun:[data quickSort]).
-     Transcript show:'quick sorted  '; showCR:(Time millisecondsToRun:[data quickSort]).
-     data reverse.
-     Transcript show:'quick reverse '; showCR:(Time millisecondsToRun:[data quickSort]).
-    "
+    
+    |mySize|
+
+    mySize := self size.
+    mySize <= 1 ifTrue:[
+        ^ self
+    ].
+    startIndex = stopIndex ifTrue:[
+        ^ self
+    ].
+    (startIndex >= 1 and:[ startIndex < stopIndex ]) ifFalse:[
+        self error:'bad start index'
+    ].
+    stopIndex > mySize ifTrue:[
+        self error:'bad stop index'
+    ].
+    self
+        mergeSortFrom:startIndex
+        to:stopIndex
+        by:aBlock.
 !
 
 quickSort
     "sort the collection inplace. The elements are compared using
      '<' i.e. they should offer a magnitude-like protocol.
 
+     Quick sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
      case behavior). See also #randomizedSort for a version with better
@@ -7502,18 +7811,31 @@
 
     stop := self size.
     (stop > 1) ifTrue:[
-	self quickSortFrom:1 to:stop
+        self quickSortFrom:1 to:stop
     ]
 
     "
      #(1 16 7 98 3 19 4 0) sort
 
      |data|
-     data := Random new next:100000.
-     'random  ' print. (Time millisecondsToRun:[data sort]) printNL.
-     'sorted  ' print. (Time millisecondsToRun:[data sort]) printNL.
+     data := Random new next:500001.
+     Transcript show:'quick random  '; showCR:(Time millisecondsToRun:[data quickSort]).
+     data inject:0 into:[:lastElement :each | lastElement > each ifTrue:[self halt]. each].
+     Transcript show:'quick sorted  '; showCR:(Time millisecondsToRun:[data quickSort]).
      data reverse.
-     'reverse ' print. (Time millisecondsToRun:[data sort]) printNL.
+     Transcript show:'quick reverse '; showCR:(Time millisecondsToRun:[data quickSort]).
+
+     |data rg|  
+     rg := Random new.
+     data := Array new:500001.
+     1 to:data size do:[:i |
+        data at:i put:(rg nextIntegerBetween:1 and:100).
+     ].
+     Transcript show:'quick random  '; showCR:(Time millisecondsToRun:[data quickSort]).
+     data inject:0 into:[:lastElement :each | lastElement > each ifTrue:[self halt]. each].
+     Transcript show:'quick sorted  '; showCR:(Time millisecondsToRun:[data quickSort]).
+     data reverse.
+     Transcript show:'quick reverse '; showCR:(Time millisecondsToRun:[data quickSort]).
     "
 
     "Modified: 21.8.1997 / 18:31:52 / cg"
@@ -7523,6 +7845,9 @@
     "sort the collection inplace using the 2-arg block sortBlock
      for comparison. This allows any sort criteria to be implemented.
 
+     Quick sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
      case behavior). See also #randomizedSort: for a version with better
@@ -7532,12 +7857,12 @@
 
     stop := self size.
     (stop > 1) ifTrue:[
-	sortBlock numArgs == 3 ifTrue:[
-	    "/ TODO: pass a collating policy to aBlock
-	    self quickSortFrom:1 to:stop sortBlock:sortBlock policy:(StringCollationPolicy new)
-	] ifFalse:[
-	    self quickSortFrom:1 to:stop sortBlock:sortBlock
-	]
+        sortBlock numArgs == 3 ifTrue:[
+            "/ TODO: pass a collating policy to aBlock
+            self quickSortFrom:1 to:stop sortBlock:sortBlock policy:(StringCollationPolicy new)
+        ] ifFalse:[
+            self quickSortFrom:1 to:stop sortBlock:sortBlock
+        ]
     ]
 
     "
@@ -7555,6 +7880,9 @@
      for comparison. Also reorder the elements in aCollection.
      Use this, when you have a key collection to sort some other collection with.
 
+     Quick sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
      case behavior). See also #randomizedSort: for a version with better
@@ -7564,7 +7892,7 @@
 
     stop := self size.
     (stop > 1) ifTrue:[
-	self quickSortFrom:1 to:stop sortBlock:sortBlock with:aCollection
+        self quickSortFrom:1 to:stop sortBlock:sortBlock with:aCollection
     ]
 
     "
@@ -7584,16 +7912,18 @@
      Also, the elements of aCollection are reordered with it.
      Use this, when you have a key collection to sort another collection with.
 
+     Quick sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
-     case behavior). See also #randomizedSort: for a version with better
-     worstCase behavior (but worse average & bestCase behavior)"
+     case behavior)."
 
     |stop|
 
     stop := self size.
     (stop > 1) ifTrue:[
-	self quickSortFrom:1 to:stop with:aCollection
+        self quickSortFrom:1 to:stop with:aCollection
     ]
 
     "Modified: 21.8.1997 / 18:32:21 / cg"
@@ -7648,6 +7978,7 @@
 !
 
 randomizedSort
+    <resource: #obsolete>
     "sort the collection inplace. The elements are compared using
      '<' i.e. they should offer a magnitude-like protocol.
 
@@ -7669,6 +8000,7 @@
 !
 
 randomizedSort:sortBlock
+    <resource: #obsolete>
     "sort the collection inplace using the 2-arg block sortBlock
      for comparison. This allows any sort criteria to be implemented.
 
@@ -7690,6 +8022,7 @@
 !
 
 randomizedSort:sortBlock with:aCollection
+    <resource: #obsolete>
     "sort the collection inplace using the 2-arg block sortBlock
      for comparison. Also reorder the elements in aCollection.
      Use this, when you have a key collection to sort some other collection with.
@@ -7712,6 +8045,7 @@
 !
 
 randomizedSortWith:aCollection
+    <resource: #obsolete>
     "sort the receiver collection inplace, using '<' to compare elements.
      Also, the elements of aCollection are reordered with it.
      Use this, when you have a key collection to sort another collection with.
@@ -7775,8 +8109,7 @@
 
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
-     case behavior). See also #randomizedSort for a version with better
-     worstCase behavior (but worse average & bestCase behavior)"
+     case behavior)."
 
     self quickSort
 
@@ -7785,10 +8118,10 @@
 
      |data|
      data := Random new next:100000.
-     'random  ' print. (Time millisecondsToRun:[data sort]) printNL.
-     'sorted  ' print. (Time millisecondsToRun:[data sort]) printNL.
+     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data sort]).
+     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data sort]).
      data reverse.
-     'reverse ' print. (Time millisecondsToRun:[data sort]) printNL.
+     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data sort]).
     "
 
     "Modified: 21.8.1997 / 18:31:52 / cg"
@@ -7800,8 +8133,7 @@
 
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
-     case behavior). See also #randomizedSort: for a version with better
-     worstCase behavior (but worse average & bestCase behavior)"
+     case behavior)."
 
     self quickSort:sortBlock
 
@@ -7822,8 +8154,7 @@
 
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
-     case behavior). See also #randomizedSort: for a version with better
-     worstCase behavior (but worse average & bestCase behavior)"
+     case behavior)."
 
     self quickSort:sortBlock with:aCollection
 
@@ -7877,8 +8208,7 @@
 
      The implementation uses the quicksort algorithm, which may not be
      the best possible for all situations (quickSort has O-square worst
-     case behavior). See also #randomizedSort: for a version with better
-     worstCase behavior (but worse average & bestCase behavior)"
+     case behavior)."
 
     self quickSortWith:aCollection
 
@@ -7904,6 +8234,50 @@
     "Modified: / 22-10-2008 / 21:25:07 / cg"
 !
 
+stableSort
+    "sort the collection inplace. The elements are compared using
+     '<=' i.e. they should offer a magnitude-like protocol.
+
+     Use a stable sort algorithm - i.e. elements having an equal key will keep
+     their previous order."
+
+    self mergeSort
+
+    "
+     #(1 16 7 98 3 19 4 0) stableSort
+
+     |data|
+     data := Random new next:100000.
+     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data stableSort]).
+     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data stableSort]).
+     data reverse.
+     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data stableSort]).
+    "
+!
+
+stableSort:sortBlock
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. This allows any sort criteria to be implemented.
+
+     Use a stable sort algorithm - i.e. elements having an equal key will keep
+     their previous order.
+
+     NOTE: the sort algorithm will be stable, if the sortblock uses #< or #> for comparison!!
+           Do not use #<= of #>= if you want stable behavior."
+
+    self mergeSort:sortBlock
+
+    "
+     The 4@bla points keep their order:
+         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
+          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} stableSort:[:a :b | a x < b x]
+        
+     But not with quickSort:
+         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
+          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} sort:[:a :b | a x < b x]
+    "
+!
+
 topologicalSort:sortBlock
     "sort the collection inplace using a sloooow sort algorithm.
      This algorithm has O-square runtime behavior and should be used only
@@ -7995,11 +8369,11 @@
 !SequenceableCollection class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.313 2012/02/29 12:49:20 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.316 2012/04/12 19:14:06 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: SequenceableCollection.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: SequenceableCollection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 SequenceableCollection initialize!
--- a/SmalltalkLanguage.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/SmalltalkLanguage.st	Fri Apr 13 14:18:13 2012 +0100
@@ -136,9 +136,9 @@
 
 , anObject
     "Emulates symbol behavior. This is sometimes required
-     as Smalltalk language is used by legacy code to access
-     current language. Future versions should contain class
-     Locale.
+     as 'Smalltalk language' is used by legacy code to access
+     the current language setting. 
+     Future versions should contain class Locale.
     "
     <resource: #obsolete>
 
@@ -146,6 +146,7 @@
     ^ Language , anObject
 
     "Created: / 22-08-2009 / 09:33:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified (comment): / 01-04-2012 / 13:19:28 / cg"
 !
 
 asSymbol
@@ -219,15 +220,15 @@
 !SmalltalkLanguage class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.15 2011/01/30 14:20:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.16 2012/04/01 11:21:32 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.15 2011/01/30 14:20:27 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.16 2012/04/01 11:21:32 cg Exp §'
 !
 
 version_SVN
-    ^'$Id: SmalltalkLanguage.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^'$Id: SmalltalkLanguage.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 
--- a/SortedCollection.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/SortedCollection.st	Fri Apr 13 14:18:13 2012 +0100
@@ -536,7 +536,7 @@
         addedCollection := aCollection.
     ] ifFalse:[
         addedCollection := Array withAll:aCollection.
-        addedCollection sort:sortBlock.
+        addedCollection stableSort:sortBlock.
 
         mySize == 0 ifTrue:[
             "/ special case: I am empty - add them en-bloque.
@@ -1060,11 +1060,11 @@
 !SortedCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.69 2009/09/28 15:45:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.70 2012/04/12 19:14:44 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: SortedCollection.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: SortedCollection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 SortedCollection initialize!
--- a/Stream.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Stream.st	Fri Apr 13 14:18:13 2012 +0100
@@ -196,7 +196,6 @@
 
 
 
-
 !Stream methodsFor:'accessing'!
 
 contents
@@ -2572,10 +2571,24 @@
     ^ self subclassResponsibility
 !
 
+isEmptyOrNil
+    "return true, if the contents of the stream is empty
+     (we already know, that we are not nil)"
+
+    ^ self isEmpty
+!
+
 notEmpty
     "return true, if the contents of the stream is not empty"
 
     ^ self isEmpty not
+!
+
+notEmptyOrNil
+    "return true, if the contents of the stream is empty
+     (we already know, that we are not nil)"
+
+    ^ self isEmpty not
 ! !
 
 !Stream methodsFor:'visiting'!
@@ -3217,15 +3230,15 @@
 !Stream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.189 2011/05/30 08:56:49 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.190 2012/04/05 09:58:52 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Stream.st,v 1.189 2011/05/30 08:56:49 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Stream.st,v 1.190 2012/04/05 09:58:52 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Stream.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Stream.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 Stream initialize!
--- a/String.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/String.st	Fri Apr 13 14:18:13 2012 +0100
@@ -11,7 +11,7 @@
 "
 "{ Package: 'stx:libbasic' }"
 
-CharacterArray variableByteSubclass:#String
+CharacterArray subclass:#String
 	instanceVariableNames:''
 	classVariableNames:'CRLF LF'
 	poolDictionaries:''
@@ -44,56 +44,6 @@
 %}
 ! !
 
-!String primitiveFunctions!
-%{
-
-static int
-nextOnKeyboard(char1, char2)
-{
-    /* compare two characters if they are next to each other on a (US-) keyboard */
-
-    static char *us_keys[] = { "1234567890-",
-			    "*qwertyuiop",
-			    "**asdfghjkl:",
-			    "***zxcvbnm",
-			    0 };
-    static char *de_keys[] = { "1234567890-",
-			    "*qwertzuiop",
-			    "**asdfghjkl:",
-			    "***yxcvbnm",
-			    0 };
-    char **keys = us_keys;
-    char **line1, **line2;
-    char *col1, *col2;
-    int diff;
-
-    for (line1 = keys; *line1 != 0; line1++) {
-	for (col1 = *line1; *col1 != 0 && *col1 != char1; col1++)
-	    continue;
-    }
-    if (*col1 == 0)
-	return(0);
-
-    for (line2 = keys; *line2 != 0; line2++) {
-	for (col2 = *line2; *col2 != 0 && *col2 != char2; col2++)
-	    continue;
-    }
-    if (*col2 == 0)
-	return(0);
-
-    diff = col1 - col2;
-    if (diff > 1 || diff < -1)
-	return(0);
-
-    diff = line1 - line2;
-    if (diff > 1 || diff < -1)
-	return(0);
-    return(1);
-}
-
-%}
-! !
-
 !String class methodsFor:'documentation'!
 
 copyright
@@ -488,8 +438,6 @@
     ^ Character tab asString
 ! !
 
-
-
 !String class methodsFor:'queries'!
 
 defaultPlatformClass
@@ -509,11 +457,6 @@
     "Modified: 23.4.1996 / 16:00:38 / cg"
 ! !
 
-
-
-
-
-
 !String methodsFor:'Compatibility-VW5.4'!
 
 asGUID
@@ -707,7 +650,6 @@
     "
 ! !
 
-
 !String methodsFor:'character searching'!
 
 identityIndexOf:aCharacter
@@ -2146,8 +2088,7 @@
 !String methodsFor:'copying'!
 
 , aString
-    "return the concatenation of myself and the argument, aString as
-     a String.
+    "return the concatenation of myself and the argument, aString as a String.
      - reimplemented here for speed"
 
 %{
@@ -2157,77 +2098,77 @@
     OBJ myClass, argClass, newString;
 
     if (__isNonNilObject(s)) {
-	myClass = __qClass(self);
-	argClass = __qClass(s);
-	/*
-	 * can do it here if both are Strings/Symbols:
-	 */
-	if (((myClass == _string) || (myClass == Symbol))
-	 && ((argClass == _string) || (argClass == Symbol))) {
-	    l1 = __stringSize(self);
-	    l2 = __stringSize(s);
-
-	    sz = OHDR_SIZE + l1 + l2 + 1;
-	    __qNew(newString, sz);      /* OBJECT ALLOCATION */
-	    if (newString != nil) {
-		char *cp1, *cp2;
-		REGISTER unsigned char *dstp;
-
-		__InstPtr(newString)->o_class = String;
-		__qSTORE(newString, String);
-		dstp = __stringVal(newString);
-		cp1 = (char *) __stringVal(self);
-		cp2 = (char *) __stringVal(aString);
+        myClass = __qClass(self);
+        argClass = __qClass(s);
+        /*
+         * can do it here if both are Strings/Symbols:
+         */
+        if (((myClass == _string) || (myClass == Symbol))
+         && ((argClass == _string) || (argClass == Symbol))) {
+            l1 = __stringSize(self);
+            l2 = __stringSize(s);
+
+            sz = OHDR_SIZE + l1 + l2 + 1;
+            __qNew(newString, sz);      /* OBJECT ALLOCATION */
+            if (newString != nil) {
+                char *cp1, *cp2;
+                REGISTER unsigned char *dstp;
+
+                __InstPtr(newString)->o_class = String;
+                __qSTORE(newString, String);
+                dstp = __stringVal(newString);
+                cp1 = (char *) __stringVal(self);
+                cp2 = (char *) __stringVal(aString);
 
 #ifdef bcopy4
-		/* knowing that allocation is 4-byte aligned and
-		 * size rounded up to next 4-byte, the first copy
-		 * can be done word-wise.
-		 * that speeds up size-10-string , size-10-string
-		 * by 10% on a P5/200.
-		 */
-		{
-		    int nw = l1 >> 2;
-
-		    if (l1 & 3) nw++;
-		    bcopy4(cp1, dstp, nw);
-		    dstp += l1;
-		}
+                /* knowing that allocation is 4-byte aligned and
+                 * size rounded up to next 4-byte, the first copy
+                 * can be done word-wise.
+                 * that speeds up size-10-string , size-10-string
+                 * by 10% on a P5/200.
+                 */
+                {
+                    int nw = l1 >> 2;
+
+                    if (l1 & 3) nw++;
+                    bcopy4(cp1, dstp, nw);
+                    dstp += l1;
+                }
 #else
 # ifdef FAST_MEMCPY
-		memcpy(dstp, cp1, l1);
-		dstp += l1;
+                memcpy(dstp, cp1, l1);
+                dstp += l1;
 # else
-		while (l1 >= 4) {
-		    *(int *)dstp = *(int *)cp1;
-		    dstp += 4; cp1 += 4;
-		    l1 -= 4;
-		}
-		while (l1--) *dstp++ = *cp1++;
+                while (l1 >= 4) {
+                    *(int *)dstp = *(int *)cp1;
+                    dstp += 4; cp1 += 4;
+                    l1 -= 4;
+                }
+                while (l1--) *dstp++ = *cp1++;
 # endif
 #endif
 
 #ifdef bcopy4
-		if (((INT)dstp & 3) == 0) {
-		    int nw = l2 >> 2;
-
-		    if (l2 & 3) nw++;
-		    bcopy4(cp2, dstp, nw);
-		    *(dstp + l2) = '\0';
-		    RETURN ( newString );
-		}
+                if (((INT)dstp & 3) == 0) {
+                    int nw = l2 >> 2;
+
+                    if (l2 & 3) nw++;
+                    bcopy4(cp2, dstp, nw);
+                    *(dstp + l2) = '\0';
+                    RETURN ( newString );
+                }
 #endif
 
 #ifdef FAST_MEMCPY
-		memcpy(dstp, cp2, l2+1);
-		dstp[l2] = '\0';
+                memcpy(dstp, cp2, l2+1);
+                dstp[l2] = '\0';
 #else
-		while (l2--) *dstp++ = *cp2++;
-		*dstp = '\0';
+                while (l2--) *dstp++ = *cp2++;
+                *dstp = '\0';
 #endif
-		RETURN ( newString );
-	    }
-	}
+                RETURN ( newString );
+            }
+        }
     }
 %}.
     ^ super , aString
@@ -2236,6 +2177,8 @@
      'hello' , 'world'
      #[0 0 0 1] asString, #[0 0 0 2 0] asString
     "
+
+    "Modified: / 01-04-2012 / 13:19:44 / cg"
 !
 
 concatenate:string1 and:string2
@@ -2613,7 +2556,6 @@
     ^ super simpleDeepCopy
 ! !
 
-
 !String methodsFor:'filling & replacing'!
 
 atAllPut:aCharacter
@@ -3777,17 +3719,13 @@
 !String class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.280 2012/01/10 16:11:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.281 2012/04/01 11:27:41 cg Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/String.st,v 1.280 2012/01/10 16:11:13 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/String.st,v 1.281 2012/04/01 11:27:41 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: String.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: String.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
-
-
-
-
--- a/Unicode16String.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Unicode16String.st	Fri Apr 13 14:18:13 2012 +0100
@@ -11,7 +11,7 @@
 "
 "{ Package: 'stx:libbasic' }"
 
-TwoByteString variableWordSubclass:#Unicode16String
+TwoByteString subclass:#Unicode16String
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
@@ -81,7 +81,6 @@
     "
 ! !
 
-
 !Unicode16String methodsFor:'conversion'!
 
 asSymbolIfInterned
@@ -92,11 +91,17 @@
 
     |s|
 
-    Error catch:[
+    [
         s := self asSingleByteString.
+    ] on:Error do:[:ex|
+        ^ nil.
     ].
-    s isNil ifTrue:[^ s].
     ^ s asSymbolIfInterned
+
+    "
+     (Unicode16String with:(Character value:16rFFFF)) asSymbolIfInterned
+     'new' asUnicodeString asSymbolIfInterned
+    "
 !
 
 asUnicode16String
@@ -152,24 +157,19 @@
     "Modified: / 25-01-2012 / 11:59:34 / cg"
 ! !
 
-
 !Unicode16String class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.16 2012/01/25 11:00:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.17 2012/04/02 16:57:21 stefan Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.16 2012/01/25 11:00:07 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.17 2012/04/02 16:57:21 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Unicode16String.st 10790 2012-03-13 15:46:50Z vranyj1 $'
+    ^ '$Id: Unicode16String.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 
 ! !
 
 Unicode16String initialize!
-
-
-
-
--- a/UninterpretedBytes.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/UninterpretedBytes.st	Fri Apr 13 14:18:13 2012 +0100
@@ -2932,16 +2932,13 @@
 !UninterpretedBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.81 2012/01/09 15:19:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.84 2012/04/03 14:25:21 stefan Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.81 2012/01/09 15:19:32 cg Exp '
+    ^ '§Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.84 2012/04/03 14:25:21 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: UninterpretedBytes.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: UninterpretedBytes.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
-
-
-
--- a/WeakArray.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/WeakArray.st	Fri Apr 13 14:18:13 2012 +0100
@@ -265,7 +265,7 @@
 
     el := self basicAt:index.
     el == 0 ifTrue:[
-        ^ exeptionalValue value
+	^ exeptionalValue value
     ].
     ^ el
 !
@@ -299,7 +299,7 @@
 #ifdef WEAK_DEBUG
 		    if (! __ISVALIDOBJECT(el)) {
 			fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-			__dumpObject__(el);
+			__dumpObject__(el, __LINE__);
 			el = nil;
 		    }
 #endif
@@ -540,7 +540,7 @@
 #ifdef WEAK_DEBUG
 			    if (! __ISVALIDOBJECT(element)) {
 				fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-				__dumpObject__(element);
+				__dumpObject__(element, __LINE__);
 				element = nil;
 			    }
 #endif
@@ -576,7 +576,7 @@
 #ifdef WEAK_DEBUG
 		if (! __ISVALIDOBJECT(element)) {
 		    fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-		    __dumpObject__(element);
+		    __dumpObject__(element, __LINE__);
 		    element = nil;
 		}
 #endif
@@ -621,7 +621,7 @@
 #ifdef WEAK_DEBUG
 	    if (! __ISVALIDOBJECT(element)) {
 		fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-		__dumpObject__(element);
+		__dumpObject__(element, __LINE__);
 		element = nil;
 	    }
 #endif
@@ -725,7 +725,7 @@
 #ifdef WEAK_DEBUG
 				if (! __ISVALIDOBJECT(element)) {
 				    fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-				    __dumpObject__(element);
+				    __dumpObject__(element, __LINE__);
 				    element = nil;
 				}
 #endif
@@ -767,7 +767,7 @@
 #ifdef WEAK_DEBUG
 		    if (! __ISVALIDOBJECT(element)) {
 			fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-			__dumpObject__(element);
+			__dumpObject__(element, __LINE__);
 			element = nil;
 		    }
 #endif
@@ -817,7 +817,7 @@
 #ifdef WEAK_DEBUG
 		if (! __ISVALIDOBJECT(element)) {
 		    fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-		    __dumpObject__(element);
+		    __dumpObject__(element, __LINE__);
 		    element = nil;
 		}
 #endif
@@ -882,7 +882,7 @@
 #ifdef WEAK_DEBUG
 				if (! __ISVALIDOBJECT(element)) {
 				    fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-				    __dumpObject__(element);
+				    __dumpObject__(element, __LINE__);
 				    element = nil;
 				}
 #endif
@@ -924,7 +924,7 @@
 #ifdef WEAK_DEBUG
 		    if (! __ISVALIDOBJECT(element)) {
 			fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-			__dumpObject__(element);
+			__dumpObject__(element, __LINE__);
 			element = nil;
 		    }
 #endif
@@ -974,7 +974,7 @@
 #ifdef WEAK_DEBUG
 		if (! __ISVALIDOBJECT(element)) {
 		    fprintf(stderr, "****** OOPS - invalid Weak-Read\n");
-		    __dumpObject__(element);
+		    __dumpObject__(element, __LINE__);
 		    element = nil;
 		}
 #endif
@@ -1020,15 +1020,15 @@
 !WeakArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.66 2010/08/11 14:11:08 sr Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.67 2012/03/26 17:02:56 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.66 2010/08/11 14:11:08 sr Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/WeakArray.st,v 1.67 2012/03/26 17:02:56 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: WeakArray.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: WeakArray.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 ! !
 
 WeakArray initialize!
--- a/Win32OperatingSystem.st	Fri Apr 13 00:04:07 2012 +0100
+++ b/Win32OperatingSystem.st	Fri Apr 13 14:18:13 2012 +0100
@@ -7536,14 +7536,18 @@
     |hostName|
 
 %{  /* STACK: 2048 */
-    char buffer[512];
-    DWORD buffSize = sizeof(buffer);
-
-    if (GetComputerNameExA(ComputerNameDnsFullyQualified, buffer, &buffSize) == TRUE) {
-	hostName = __MKSTRING(buffer);
-    }
-%}.
-    ^ hostName
+    WCHAR buffer[512];
+    DWORD buffSize = sizeof(buffer)/sizeof(buffer[0]);
+
+    // Note: GetComputerNameExA can fail in certain locales!
+    if (GetComputerNameExW(ComputerNameDnsFullyQualified, buffer, &buffSize) == TRUE) {
+        hostName = __MKU16STRING_MAXLEN(buffer, buffSize);
+    }
+%}.
+    hostName isNil ifTrue:[
+        ^ nil.
+    ].
+    ^ hostName asSingleByteStringIfPossible
 
     "
      OperatingSystem getHostName
@@ -16424,16 +16428,15 @@
 !Win32OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.433 2012/01/20 12:33:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.436 2012/04/03 20:26:33 stefan Exp $'
 !
 
 version_CVS
-
-    ^ '§Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.433 2012/01/20 12:33:35 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.436 2012/04/03 20:26:33 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Win32OperatingSystem.st 10763 2012-01-22 23:07:15Z vranyj1 $'
+    ^ '$Id: Win32OperatingSystem.st 10804 2012-04-13 13:18:13Z vranyj1 $'
 
 ! !
 
--- a/libbasic.vcproj	Fri Apr 13 00:04:07 2012 +0100
+++ b/libbasic.vcproj	Fri Apr 13 14:18:13 2012 +0100
@@ -14,6 +14,9 @@
 		/>
 	</Platforms>
 	<ToolFiles>
+		<ToolFile
+			RelativePath="..\rules\vc_stc_rules.rules"
+		/>
 	</ToolFiles>
 	<Configurations>
 		<Configuration
@@ -30,6 +33,9 @@
 				Name="VCCustomBuildTool"
 			/>
 			<Tool
+				Name="ST_to_C"
+			/>
+			<Tool
 				Name="VCXMLDataGeneratorTool"
 			/>
 			<Tool
@@ -95,7 +101,7 @@
 			/>
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\*.*&quot;&#x0D;&#x0A;echo libbasic copied to &quot;$(SolutionDir)&quot;"
+				CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\*.*&quot;&#x0D;&#x0A;echo libbasic copied to &quot;$(SolutionDir)&quot;&#x0D;&#x0A;"
 			/>
 		</Configuration>
 		<Configuration
@@ -113,6 +119,9 @@
 				Name="VCCustomBuildTool"
 			/>
 			<Tool
+				Name="ST_to_C"
+			/>
+			<Tool
 				Name="VCXMLDataGeneratorTool"
 			/>
 			<Tool
@@ -186,563 +195,1386 @@
 				>
 			</File>
 			<File
+				RelativePath=".\AbortAllOperationRequest.st"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="ST_to_C"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath=".\AbortAllOperationWantedQuery.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbortAllOperationWantedQuery.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AbortOperationRequest.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbortOperationRequest.st"
+				>
+			</File>
+			<File
+				RelativePath=".\AbstractDesktop.st"
+				>
+			</File>
+			<File
+				RelativePath=".\AbstractNumberVector.c"
+				>
+			</File>
+			<File
+				RelativePath=".\AbstractNumberVector.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AbstractOperatingSystem.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbstractOperatingSystem.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AbstractSourceFileReader.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbstractSourceFileReader.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AbstractSourceFileWriter.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbstractSourceFileWriter.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AbstractTime.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AbstractTime.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ActivityNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ActivityNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AllocationFailure.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AllocationFailure.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AmbiguousMessage.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AmbiguousMessage.st"
+				>
+			</File>
+			<File
+				RelativePath=".\AnnotatedMethod.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Annotation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Annotation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ApplicationDefinition.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ApplicationDefinition.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ArgumentError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ArgumentError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ArithmeticError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ArithmeticError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ArithmeticValue.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ArithmeticValue.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Array.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Array.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ArrayedCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ArrayedCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AspectVisitor.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AspectVisitor.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AssertionFailedError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AssertionFailedError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Association.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Association.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AutoDeletedFilename.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AutoDeletedFilename.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Autoload.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Autoload.st"
+				>
+			</File>
+			<File
 				RelativePath=".\AutoloadMetaclass.c"
 				>
 			</File>
 			<File
+				RelativePath=".\AutoloadMetaclass.st"
+				>
+			</File>
+			<File
 				RelativePath=".\BadLiteralsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\BadLiteralsError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\BadRomanNumberFormatError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Bag.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Bag.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Behavior.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Behavior.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Block.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Block.st"
+				>
+			</File>
+			<File
 				RelativePath=".\BlockContext.c"
 				>
 			</File>
 			<File
+				RelativePath=".\BlockContext.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Boolean.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Boolean.st"
+				>
+			</File>
+			<File
 				RelativePath=".\BreakPointInterrupt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\BreakPointInterrupt.st"
+				>
+			</File>
+			<File
 				RelativePath=".\BuiltinLookup.c"
 				>
 			</File>
 			<File
+				RelativePath=".\BuiltinLookup.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ByteArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ByteArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CachingRegistry.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CachingRegistry.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CannotResumeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CannotResumeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CannotReturnError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CannotReturnError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Character.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Character.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterEncoder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterEncoder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterEncoderError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterEncoderError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterEncoderImplementations__EBCDIC.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterEncoderImplementations__EBCDIC.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterRangeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterRangeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CharacterWriteStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CharacterWriteStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CheapBlock.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CheapBlock.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Class.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Class.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ClassBuilder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ClassBuilder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ClassBuildError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ClassBuildError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ClassCategoryReader.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ClassCategoryReader.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ClassDescription.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ClassDescription.st"
+				>
+			</File>
+			<File
+				RelativePath=".\CmdLineOption.st"
+				>
+			</File>
+			<File
+				RelativePath=".\CmdLineOptionError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\CmdLineParser.st"
+				>
+			</File>
+			<File
+				RelativePath=".\CmdLineParserTest.st"
+				>
+			</File>
+			<File
+				RelativePath=".\CodeComponent.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Collection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Collection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\CompiledCode.c"
 				>
 			</File>
 			<File
+				RelativePath=".\CompiledCode.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Complex.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Complex.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ConfigurableFeatures.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ConfigurableFeatures.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Context.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Context.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ContextError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ContextError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Continuation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Continuation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ControlInterrupt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ControlInterrupt.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ControlRequest.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ControlRequest.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ConversionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ConversionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Date.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Date.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DateConversionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DateConversionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DecodingError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DecodingError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DeepCopyError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DeepCopyError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Delay.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Delay.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Dictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Dictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DirectoryStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DirectoryStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DomainError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DomainError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\DoubleArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\DoubleArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ElementBoundsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ElementBoundsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\EncodedStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\EncodedStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ASCII.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ASCII.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_BIG5.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_CNS11643.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_CP437.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_GB2313_1980.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_HANGUL.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO10646_1.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO10646_1.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO10646_to_SGML.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO10646_to_UTF16BE.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO10646_to_UTF16LE.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO10646_to_UTF8.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO10646_to_UTF8.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO8859_1.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO8859_1.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_10.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_11.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_13.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_14.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO8859_15.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO8859_15.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_16.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO8859_2.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO8859_2.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_3.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_4.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO8859_5.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO8859_5.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_6.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_ISO8859_7.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_ISO8859_7.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_8.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_ISO8859_9.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JavaText.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JIS0201.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JIS0208.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JIS0208_to_EUC.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JIS0208_to_JIS7.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JIS0212.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_JOHAB.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_KOI7.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_KOI8_R.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_KOI8_U.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_KSC5601.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Arabic.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_CentralEuropean.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Croatian.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Cyrillic.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Dingbats.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Farsi.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Greek.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Hebrew.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Iceland.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Japanese.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Korean.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Roman.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Romanian.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Symbol.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Thai.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MAC_Turkish.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_MS_Ansi.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_MS_Ansi.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MS_Arabic.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_MS_Baltic.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_MS_Baltic.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_MS_Cyrillic.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_MS_Cyrillic.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MS_EastEuropean.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_MS_Greek.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_MS_Greek.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MS_Hebrew.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MS_Symbol.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_MS_Turkish.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Encoder_NEXT.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_SingleByteEncoder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_SingleByteEncoder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_SJIS.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_SJIS.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Encoder_TwoByteEncoder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Encoder_TwoByteEncoder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\EncodingError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\EncodingError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\EndOfStreamError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\EndOfStreamError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\EndOfStreamNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\EndOfStreamNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Error.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Error.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Exception.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Exception.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExceptionHandlerSet.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExceptionHandlerSet.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExecutableFunction.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExecutableFunction.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExecutionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExecutionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalAddress.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalAddress.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalBytes.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalBytes.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalFunction.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalFunction.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalFunctionCallback.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalFunctionCallback.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalLibrary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalLibrary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalLibraryFunction.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalLibraryFunction.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ExternalStructure.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ExternalStructure.st"
+				>
+			</File>
+			<File
 				RelativePath=".\False.c"
 				>
 			</File>
 			<File
+				RelativePath=".\False.st"
+				>
+			</File>
+			<File
 				RelativePath=".\FileDirectory.c"
 				>
 			</File>
 			<File
+				RelativePath=".\FileDirectory.st"
+				>
+			</File>
+			<File
 				RelativePath=".\FileDoesNotExistException.c"
 				>
 			</File>
 			<File
+				RelativePath=".\FileDoesNotExistException.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Filename.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Filename.st"
+				>
+			</File>
+			<File
 				RelativePath=".\FileStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\FileStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\FixedPoint.c"
 				>
 			</File>
 			<File
+				RelativePath=".\FixedPoint.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Float.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Float.st"
+				>
+			</File>
+			<File
 				RelativePath=".\FloatArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\FloatArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Fraction.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Fraction.st"
+				>
+			</File>
+			<File
 				RelativePath=".\GenericException.c"
 				>
 			</File>
 			<File
+				RelativePath=".\GenericException.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Geometric.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Geometric.st"
+				>
+			</File>
+			<File
 				RelativePath=".\GetOpt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\GetOpt.st"
+				>
+			</File>
+			<File
+				RelativePath=".\GNOMEDesktop.st"
+				>
+			</File>
+			<File
 				RelativePath=".\HaltInterrupt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\HaltInterrupt.st"
+				>
+			</File>
+			<File
 				RelativePath=".\HandleRegistry.c"
 				>
 			</File>
 			<File
+				RelativePath=".\HandleRegistry.st"
+				>
+			</File>
+			<File
 				RelativePath=".\HashStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\HashStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\IdentityDictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\IdentityDictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\IdentitySet.c"
 				>
 			</File>
 			<File
+				RelativePath=".\IdentitySet.st"
+				>
+			</File>
+			<File
+				RelativePath=".\ImaginaryResultError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ImmutableArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ImmutableArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ImmutableByteArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ImmutableByteArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ImmutableString.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ImmutableString.st"
+				>
+			</File>
+			<File
 				RelativePath=".\IncompleteNextCountError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\IncompleteNextCountError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\IndexNotFoundError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\IndexNotFoundError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\Infinity.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InlineObject.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InlineObject.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InlineObjectClassDescription.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InlineObjectClassDescription.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InlineObjectPrototype.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InlineObjectPrototype.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Integer.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Integer.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InterestConverter.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InterestConverter.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Interval.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Interval.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidByteCodeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidByteCodeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidCodeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidCodeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidEncodingError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidEncodingError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidInstructionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidInstructionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidModeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidModeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidOperationError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidOperationError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidPatchError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidPatchError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidReadError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidReadError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\InvalidWriteError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\InvalidWriteError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\KeyedCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\KeyedCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\KeyNotFoundError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\KeyNotFoundError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\LargeFloat.st"
+				>
+			</File>
+			<File
 				RelativePath=".\LargeInteger.c"
 				>
 			</File>
 			<File
-				RelativePath=".\libbasic.rc"
+				RelativePath=".\LargeInteger.st"
 				>
 			</File>
 			<File
@@ -750,119 +1582,259 @@
 				>
 			</File>
 			<File
+				RelativePath=".\LibraryDefinition.st"
+				>
+			</File>
+			<File
 				RelativePath=".\LimitedPrecisionReal.c"
 				>
 			</File>
 			<File
+				RelativePath=".\LimitedPrecisionReal.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Link.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Link.st"
+				>
+			</File>
+			<File
 				RelativePath=".\LinkedList.c"
 				>
 			</File>
 			<File
+				RelativePath=".\LinkedList.st"
+				>
+			</File>
+			<File
 				RelativePath=".\LongFloat.c"
 				>
 			</File>
 			<File
+				RelativePath=".\LongFloat.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Lookup.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Lookup.st"
+				>
+			</File>
+			<File
 				RelativePath=".\LookupKey.c"
 				>
 			</File>
 			<File
+				RelativePath=".\LookupKey.st"
+				>
+			</File>
+			<File
+				RelativePath=".\MacFilename.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Magnitude.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Magnitude.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MallocFailure.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MallocFailure.st"
+				>
+			</File>
+			<File
+				RelativePath=".\MappedExternalBytes.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MD5Stream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MD5Stream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MeasurementValue.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MeasurementValue.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Message.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Message.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MessageNotUnderstood.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MessageNotUnderstood.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MessageSend.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MessageSend.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Metaclass.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Metaclass.st"
+				>
+			</File>
+			<File
+				RelativePath=".\MetaNumber.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Method.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Method.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MethodDictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MethodDictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MiniDebugger.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MiniDebugger.st"
+				>
+			</File>
+			<File
 				RelativePath=".\MiniInspector.c"
 				>
 			</File>
 			<File
+				RelativePath=".\MiniInspector.st"
+				>
+			</File>
+			<File
+				RelativePath=".\MiniLogger.c"
+				>
+			</File>
+			<File
+				RelativePath=".\MiniLogger.st"
+				>
+			</File>
+			<File
+				RelativePath=".\NaiveRomanNumberFormatNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NameSpace.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NameSpace.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NamespaceAwareLookup.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NamespaceAwareLookup.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NoByteCodeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NoByteCodeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NoHandlerError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NoHandlerError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NoModificationError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NoModificationError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NonBooleanReceiverError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NonBooleanReceiverError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NonIntegerIndexError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NonIntegerIndexError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NonPositionableExternalStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NonPositionableExternalStream.st"
+				>
+			</File>
+			<File
+				RelativePath=".\NotANumber.st"
+				>
+			</File>
+			<File
 				RelativePath=".\NotFoundError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\NotFoundError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Notification.c"
 				>
 			</File>
 			<File
-				RelativePath=".\ntLibInit.c"
+				RelativePath=".\Notification.st"
 				>
 			</File>
 			<File
@@ -870,521 +1842,1129 @@
 				>
 			</File>
 			<File
+				RelativePath=".\Number.st"
+				>
+			</File>
+			<File
+				RelativePath=".\NumberConversionError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\NumberFormatError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Object.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Object.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ObjectCoder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ObjectCoder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ObjectMemory.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ObjectMemory.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OpenError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OpenError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\OpenVMSFileHandle.st"
+				>
+			</File>
+			<File
+				RelativePath=".\OpenVMSFilename.st"
+				>
+			</File>
+			<File
+				RelativePath=".\OpenVMSOperatingSystem.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OrderedCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OrderedCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OSErrorHolder.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OSErrorHolder.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OSFileHandle.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OSFileHandle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OSHandle.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OSHandle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsIllegalOperation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsIllegalOperation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsInaccessibleError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsInaccessibleError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsInvalidArgumentsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsInvalidArgumentsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsNeedRetryError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsNeedRetryError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsNoResourcesError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsNoResourcesError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OSProcess.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OSProcess.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OSSignalInterrupt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OSSignalInterrupt.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OsTransferFaultError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OsTransferFaultError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\OverflowError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\OverflowError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PackageId.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PackageId.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PCFilename.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PCFilename.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PeekableStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PeekableStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PipeStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PipeStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PluginSupport.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PluginSupport.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Point.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Point.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PositionableStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PositionableStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PositionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PositionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PositionOutOfBoundsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PositionOutOfBoundsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PrimitiveFailure.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PrimitiveFailure.st"
+				>
+			</File>
+			<File
 				RelativePath=".\PrivateMetaclass.c"
 				>
 			</File>
 			<File
+				RelativePath=".\PrivateMetaclass.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProceedableError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProceedableError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProceedError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProceedError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Process.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Process.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProcessorScheduler.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProcessorScheduler.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProgrammingLanguage.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProgrammingLanguage.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Project.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Project.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProjectDefinition.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProjectDefinition.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ProtoObject.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ProtoObject.st"
+				>
+			</File>
+			<File
+				RelativePath=".\PrototypeLookupAlgorithm.st"
+				>
+			</File>
+			<File
+				RelativePath=".\QualifiedName.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Query.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Query.st"
+				>
+			</File>
+			<File
 				RelativePath=".\QuerySignal.c"
 				>
 			</File>
 			<File
+				RelativePath=".\QuerySignal.st"
+				>
+			</File>
+			<File
 				RelativePath=".\QueryWithoutDefault.c"
 				>
 			</File>
 			<File
+				RelativePath=".\QueryWithoutDefault.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RangeError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RangeError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ReadError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ReadError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ReadEvalPrintLoop.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ReadEvalPrintLoop.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ReadOnlySequenceableCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ReadOnlySequenceableCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ReadStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ReadStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ReadWriteStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ReadWriteStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Rectangle.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Rectangle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RecursionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RecursionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RecursionLock.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RecursionLock.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RecursiveExceptionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RecursiveExceptionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RecursiveStoreError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RecursiveStoreError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Registry.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Registry.st"
+				>
+			</File>
+			<File
 				RelativePath=".\RestartProcessRequest.c"
 				>
 			</File>
 			<File
+				RelativePath=".\RestartProcessRequest.st"
+				>
+			</File>
+			<File
+				RelativePath=".\RomanNumberFormatError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SameForAllNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SameForAllNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Semaphore.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Semaphore.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SemaphoreSet.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SemaphoreSet.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SequenceableCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SequenceableCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Set.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Set.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SHA1Stream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SHA1Stream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SharedPool.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SharedPool.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ShortFloat.c"
 				>
 			</File>
 			<File
+				RelativePath=".\ShortFloat.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Signal.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Signal.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SignalError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SignalError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SignalSet.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SignalSet.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SmallInteger.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SmallInteger.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Smalltalk.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Smalltalk.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SmalltalkChunkFileSourceReader.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SmalltalkChunkFileSourceReader.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SmalltalkChunkFileSourceWriter.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SmalltalkChunkFileSourceWriter.st"
+				>
+			</File>
+			<File
+				RelativePath=".\SmalltalkDesktop.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SmalltalkLanguage.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SmalltalkLanguage.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SnapshotError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SnapshotError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\SomeNumber.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SortedCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SortedCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\StandaloneStartup.c"
 				>
 			</File>
 			<File
+				RelativePath=".\StandaloneStartup.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Stream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Stream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\StreamError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\StreamError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\StreamIOError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\StreamIOError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\StreamNotOpenError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\StreamNotOpenError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\String.c"
 				>
 			</File>
 			<File
+				RelativePath=".\String.st"
+				>
+			</File>
+			<File
 				RelativePath=".\StringCollection.c"
 				>
 			</File>
 			<File
+				RelativePath=".\StringCollection.st"
+				>
+			</File>
+			<File
 				RelativePath=".\stx_libbasic.c"
 				>
 			</File>
 			<File
+				RelativePath=".\stx_libbasic.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SubclassResponsibilityError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SubclassResponsibilityError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SubscriptOutOfBoundsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SubscriptOutOfBoundsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Symbol.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Symbol.st"
+				>
+			</File>
+			<File
+				RelativePath=".\not_delivered\SysDict.st"
+				>
+			</File>
+			<File
 				RelativePath=".\SystemChangeNotifier.c"
 				>
 			</File>
 			<File
+				RelativePath=".\SystemChangeNotifier.st"
+				>
+			</File>
+			<File
+				RelativePath=".\SystemNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\TerminateProcessRequest.c"
 				>
 			</File>
 			<File
+				RelativePath=".\TerminateProcessRequest.st"
+				>
+			</File>
+			<File
+				RelativePath=".\TextCollectorStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Time.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Time.st"
+				>
+			</File>
+			<File
 				RelativePath=".\TimeConversionError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\TimeConversionError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\TimeoutError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\TimeoutError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\TimeoutNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\TimeoutNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Timestamp.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Timestamp.st"
+				>
+			</File>
+			<File
 				RelativePath=".\True.c"
 				>
 			</File>
 			<File
+				RelativePath=".\True.st"
+				>
+			</File>
+			<File
 				RelativePath=".\TwoByteString.c"
 				>
 			</File>
 			<File
+				RelativePath=".\TwoByteString.st"
+				>
+			</File>
+			<File
+				RelativePath=".\UnboundedExternalStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UndefinedObject.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UndefinedObject.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UnderflowError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UnderflowError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Unicode16String.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Unicode16String.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UnimplementedFunctionalityError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UnimplementedFunctionalityError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UninterpretedBytes.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UninterpretedBytes.st"
+				>
+			</File>
+			<File
+				RelativePath=".\UnixDesktop.st"
+				>
+			</File>
+			<File
+				RelativePath=".\UnixFileDescriptorHandle.st"
+				>
+			</File>
+			<File
+				RelativePath=".\UnixFileHandle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UnixFilename.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UnixFilename.st"
+				>
+			</File>
+			<File
+				RelativePath=".\UnixOperatingSystem.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UnorderedNumbersError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UnorderedNumbersError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UnprotectedExternalBytes.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UnprotectedExternalBytes.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserConfirmation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserConfirmation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserInformation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserInformation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserInterrupt.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserInterrupt.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserMessage.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserMessage.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserNotification.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserNotification.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UserPreferences.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UserPreferences.st"
+				>
+			</File>
+			<File
 				RelativePath=".\UtcTimestamp.c"
 				>
 			</File>
 			<File
+				RelativePath=".\UtcTimestamp.st"
+				>
+			</File>
+			<File
 				RelativePath=".\VarArgBlock.c"
 				>
 			</File>
 			<File
+				RelativePath=".\VarArgBlock.st"
+				>
+			</File>
+			<File
 				RelativePath=".\VarArgCheapBlock.c"
 				>
 			</File>
 			<File
+				RelativePath=".\VarArgCheapBlock.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Visitor.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Visitor.st"
+				>
+			</File>
+			<File
+				RelativePath=".\not_delivered\VMBehavior.st"
+				>
+			</File>
+			<File
 				RelativePath=".\VMInternalError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\VMInternalError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Warning.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Warning.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakArray.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakArray.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakDependencyDictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakDependencyDictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakIdentityDictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakIdentityDictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakIdentitySet.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakIdentitySet.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakInterestConverter.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakInterestConverter.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WeakValueDictionary.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WeakValueDictionary.st"
+				>
+			</File>
+			<File
+				RelativePath=".\WeakValueIdentityDictionary.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Win32Constants.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Win32Constants.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Win32FILEHandle.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Win32FILEHandle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Win32Handle.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Win32Handle.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Win32OperatingSystem.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Win32OperatingSystem.st"
+				>
+			</File>
+			<File
 				RelativePath=".\Win32Process.c"
 				>
 			</File>
 			<File
+				RelativePath=".\Win32Process.st"
+				>
+			</File>
+			<File
+				RelativePath=".\WindowsDesktop.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WriteError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WriteError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WriteStream.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WriteStream.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WrongNumberOfArgumentsError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WrongNumberOfArgumentsError.st"
+				>
+			</File>
+			<File
 				RelativePath=".\WrongProceedabilityError.c"
 				>
 			</File>
 			<File
+				RelativePath=".\WrongProceedabilityError.st"
+				>
+			</File>
+			<File
+				RelativePath=".\XDGDesktop.st"
+				>
+			</File>
+			<File
 				RelativePath=".\YesToAllConfirmation.c"
 				>
 			</File>
 			<File
+				RelativePath=".\YesToAllConfirmation.st"
+				>
+			</File>
+			<File
 				RelativePath=".\ZeroDivide.c"
 				>
 			</File>
+			<File
+				RelativePath=".\ZeroDivide.st"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Headerdateien"