first cut
authorMartin Kobetic <mkobetic@gmail.com>
Mon, 22 Aug 2011 16:04:00 +0000
changeset 9 6c90659cf105
parent 8 661e9a63b047
child 10 3813193bdf4e
first cut
terminals/Make.proto
terminals/Make.spec
terminals/Makefile
terminals/Xtreams__BlockClosureGenerateStream.st
terminals/Xtreams__BlockClosureReadStream.st
terminals/Xtreams__BlockClosureWriteStream.st
terminals/Xtreams__BufferReadStream.st
terminals/Xtreams__BufferWriteStream.st
terminals/Xtreams__BufferedWriteStream.st
terminals/Xtreams__CollectionWriteStream.st
terminals/Xtreams__ExternalReadStream.st
terminals/Xtreams__ExternalWriteStream.st
terminals/Xtreams__FileReadStream.st
terminals/Xtreams__FileWriteStream.st
terminals/Xtreams__NullWriteStream.st
terminals/Xtreams__PointerReadStream.st
terminals/Xtreams__PointerWriteStream.st
terminals/Xtreams__SequenceableCollectionReadStream.st
terminals/Xtreams__SequenceableCollectionWriteStream.st
terminals/Xtreams__SharedQueueReadStream.st
terminals/Xtreams__SharedQueueWriteStream.st
terminals/abbrev.stc
terminals/autopackage/default.apspec
terminals/bc.mak
terminals/bmake.bat
terminals/extensions.st
terminals/lcmake.bat
terminals/libInit.cc
terminals/stx_goodies_xtreams_terminals.st
terminals/terminals.rc
terminals/tests/Make.proto
terminals/tests/Make.spec
terminals/tests/Makefile
terminals/tests/Xtreams__BlockClosureReadingWritingTest.st
terminals/tests/Xtreams__BlockClosureTest.st
terminals/tests/Xtreams__BufferReadingWritingTest.st
terminals/tests/Xtreams__BufferedWriteStreamTest.st
terminals/tests/Xtreams__CollectionReadingWritingTest.st
terminals/tests/Xtreams__ElasticBufferReadingWritingTest.st
terminals/tests/Xtreams__FileReadingWritingTest.st
terminals/tests/Xtreams__PipeReadingWritingTest.st
terminals/tests/Xtreams__PointerReadStreamTest.st
terminals/tests/Xtreams__PointerReadingWritingTest.st
terminals/tests/Xtreams__PointerWriteStreamTest.st
terminals/tests/Xtreams__RingBufferReadingWritingTest.st
terminals/tests/Xtreams__SharedQueueReadingWritingTest.st
terminals/tests/Xtreams__SocketReadingWritingTest.st
terminals/tests/abbrev.stc
terminals/tests/autopackage/default.apspec
terminals/tests/bc.mak
terminals/tests/bmake.bat
terminals/tests/lcmake.bat
terminals/tests/libInit.cc
terminals/tests/stx_goodies_xtreams_terminals_tests.st
terminals/tests/tests.rc
terminals/tests/vcmake.bat
terminals/vcmake.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Make.proto	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,143 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# The Makefile as generated by this Make.proto supports the following targets:
+#    make         - compile all st-files to a classLib
+#    make clean   - clean all temp files
+#    make clobber - clean all
+#
+# This file contains definitions for Unix based platforms.
+# It shares common definitions with the win32-make in Make.spec.
+
+#
+# position (of this package) in directory hierarchy:
+# (must point to ST/X top directory, for tools and includes)
+TOP=../../..
+INCLUDE_TOP=$(TOP)/..
+
+# subdirectories where targets are to be made:
+SUBDIRS=
+
+
+# subdirectories where Makefiles are to be made:
+# (only define if different from SUBDIRS)
+# ALLSUBDIRS=
+
+REQUIRED_SUPPORT_DIRS=
+
+# if your embedded C code requires any system includes,
+# add the path(es) here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALINCLUDES=-Ifoo -Ibar
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/goodies/xtreams/core -I$(INCLUDE_TOP)/stx/libcompat -I$(INCLUDE_TOP)/stx/libbasic
+
+
+# if you need any additional defines for embedded C code,
+# add them here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
+LOCALDEFINES=
+
+LIBNAME=libstx_goodies_xtreams_terminals
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -H.  -varPrefix=$(LIBNAME)
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C-libraries that should be pre-linked with the class-objects
+LD_OBJ_LIBS=
+LOCAL_SHARED_LIBS=
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C targets or libraries should be added below
+LOCAL_EXTRA_TARGETS=
+
+OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
+
+
+
+all:: preMake classLibRule postMake
+
+pre_objs::  update-svn-revision
+
+
+
+update-svn-revision:
+	if [ ! -r .svnversion -o "$(shell svnversion -n)" != "$(shell cat .svnversion)" ]; then \
+		svnversion -n > .svnversion; \
+		sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"'$(shell svnversion -n)'\"\$$\"/g" \
+			stx_goodies_xtreams_terminals.st; \
+	fi
+.PHONY: update-svn-revision
+
+
+# add more install actions here
+install::
+
+# add more install actions for aux-files (resources) here
+installAux::
+
+# add more preMake actions here
+preMake::
+
+# add more postMake actions here
+postMake:: cleanjunk
+
+prereq: $(REQUIRED_SUPPORT_DIRS)
+	cd ../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../core && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libboss && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libwidg3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libtool && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../libcompat && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../librun && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+cleanjunk::
+
+clean::
+	-rm -f *.o *.H
+
+clobber:: clean
+	-rm -f *.so *.dll
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)Xtreams__BlockClosureGenerateStream.$(O) Xtreams__BlockClosureGenerateStream.$(H): Xtreams__BlockClosureGenerateStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BlockClosureReadStream.$(O) Xtreams__BlockClosureReadStream.$(H): Xtreams__BlockClosureReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BlockClosureWriteStream.$(O) Xtreams__BlockClosureWriteStream.$(H): Xtreams__BlockClosureWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferReadStream.$(O) Xtreams__BufferReadStream.$(H): Xtreams__BufferReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferWriteStream.$(O) Xtreams__BufferWriteStream.$(H): Xtreams__BufferWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferedWriteStream.$(O) Xtreams__BufferedWriteStream.$(H): Xtreams__BufferedWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__CollectionWriteStream.$(O) Xtreams__CollectionWriteStream.$(H): Xtreams__CollectionWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__ExternalReadStream.$(O) Xtreams__ExternalReadStream.$(H): Xtreams__ExternalReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__ExternalWriteStream.$(O) Xtreams__ExternalWriteStream.$(H): Xtreams__ExternalWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__FileWriteStream.$(O) Xtreams__FileWriteStream.$(H): Xtreams__FileWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__NullWriteStream.$(O) Xtreams__NullWriteStream.$(H): Xtreams__NullWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__PointerReadStream.$(O) Xtreams__PointerReadStream.$(H): Xtreams__PointerReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__PointerWriteStream.$(O) Xtreams__PointerWriteStream.$(H): Xtreams__PointerWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SequenceableCollectionReadStream.$(O) Xtreams__SequenceableCollectionReadStream.$(H): Xtreams__SequenceableCollectionReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SequenceableCollectionWriteStream.$(O) Xtreams__SequenceableCollectionWriteStream.$(H): Xtreams__SequenceableCollectionWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SharedQueueReadStream.$(O) Xtreams__SharedQueueReadStream.$(H): Xtreams__SharedQueueReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SharedQueueWriteStream.$(O) Xtreams__SharedQueueWriteStream.$(H): Xtreams__SharedQueueWriteStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)stx_goodies_xtreams_terminals.$(O) stx_goodies_xtreams_terminals.$(H): stx_goodies_xtreams_terminals.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__FileReadStream.$(O) Xtreams__FileReadStream.$(H): Xtreams__FileReadStream.st $(INCLUDE_TOP)/stx/goodies/xtreams/terminals/Xtreams__ExternalReadStream.$(H) $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__ReadStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/Block.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Filename.$(H) $(INCLUDE_TOP)/stx/libbasic2/Random.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic2/SharedQueue.$(H) $(INCLUDE_TOP)/stx/libbasic2/Queue.$(H) $(INCLUDE_TOP)/stx/libbasic2/Socket.$(H) $(INCLUDE_TOP)/stx/libbasic/NonPositionableExternalStream.$(H) $(INCLUDE_TOP)/stx/libbasic/ExternalStream.$(H) $(INCLUDE_TOP)/stx/libbasic/ReadWriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/WriteStream.$(H) $(INCLUDE_TOP)/stx/libbasic/PositionableStream.$(H) $(INCLUDE_TOP)/stx/libbasic/PeekableStream.$(H) $(INCLUDE_TOP)/stx/libwidg/TextCollector.$(H) $(INCLUDE_TOP)/stx/libwidg/EditTextView.$(H) $(INCLUDE_TOP)/stx/libwidg/TextView.$(H) $(INCLUDE_TOP)/stx/libwidg/ListView.$(H) $(INCLUDE_TOP)/stx/libview/View.$(H) $(INCLUDE_TOP)/stx/libview/SimpleView.$(H) $(INCLUDE_TOP)/stx/libview/DisplaySurface.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsMedium.$(H) $(INCLUDE_TOP)/stx/libview/DeviceGraphicsContext.$(H) $(INCLUDE_TOP)/stx/libview/GraphicsContext.$(H) $(INCLUDE_TOP)/stx/libbasic/UndefinedObject.$(H) $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__Buffer.$(H) $(INCLUDE_TOP)/stx/goodies/xtreams/core/Xtreams__WriteStream.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Make.spec	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,99 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains specifications which are common to all platforms.
+#
+
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+#  to find the source code of a class and to find the library for a package)
+MODULE=stx
+MODULE_DIR=goodies/xtreams/terminals
+PACKAGE=$(MODULE):$(MODULE_DIR)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -H.         : create header files locally
+#                (if removed, they will be created as common
+#  -Pxxx       : defines the package
+#  -Zxxx       : a prefix for variables within the classLib
+#  -Dxxx       : defines passed to to CC for inline C-code
+#  -Ixxx       : include path passed to CC for inline C-code
+#  +optspace   : optimized for space
+#  +optspace2  : optimized more for space
+#  +optspace3  : optimized even more for space
+#  +optinline  : generate inline code for some ST constructs
+#  +inlineNew  : additionally inline new
+#  +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=+optspace3
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -warn            : no warnings
+#  -warnNonStandard : no warnings about ST/X extensions
+#  -warnEOLComments : no warnings about EOL comment extension
+#  -warnPrivacy     : no warnings about privateClass extension
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=-warnNonStandard
+
+COMMON_CLASSES= \
+	Xtreams::BlockClosureGenerateStream \
+	Xtreams::BlockClosureReadStream \
+	Xtreams::BlockClosureWriteStream \
+	Xtreams::BufferReadStream \
+	Xtreams::BufferWriteStream \
+	Xtreams::BufferedWriteStream \
+	Xtreams::CollectionWriteStream \
+	Xtreams::ExternalReadStream \
+	Xtreams::ExternalWriteStream \
+	Xtreams::FileWriteStream \
+	Xtreams::NullWriteStream \
+	Xtreams::PointerReadStream \
+	Xtreams::PointerWriteStream \
+	Xtreams::SequenceableCollectionReadStream \
+	Xtreams::SequenceableCollectionWriteStream \
+	Xtreams::SharedQueueReadStream \
+	Xtreams::SharedQueueWriteStream \
+	stx_goodies_xtreams_terminals \
+	Xtreams::FileReadStream \
+
+
+
+
+COMMON_OBJS= \
+    $(OUTDIR)Xtreams__BlockClosureGenerateStream.$(O) \
+    $(OUTDIR)Xtreams__BlockClosureReadStream.$(O) \
+    $(OUTDIR)Xtreams__BlockClosureWriteStream.$(O) \
+    $(OUTDIR)Xtreams__BufferReadStream.$(O) \
+    $(OUTDIR)Xtreams__BufferWriteStream.$(O) \
+    $(OUTDIR)Xtreams__BufferedWriteStream.$(O) \
+    $(OUTDIR)Xtreams__CollectionWriteStream.$(O) \
+    $(OUTDIR)Xtreams__ExternalReadStream.$(O) \
+    $(OUTDIR)Xtreams__ExternalWriteStream.$(O) \
+    $(OUTDIR)Xtreams__FileWriteStream.$(O) \
+    $(OUTDIR)Xtreams__NullWriteStream.$(O) \
+    $(OUTDIR)Xtreams__PointerReadStream.$(O) \
+    $(OUTDIR)Xtreams__PointerWriteStream.$(O) \
+    $(OUTDIR)Xtreams__SequenceableCollectionReadStream.$(O) \
+    $(OUTDIR)Xtreams__SequenceableCollectionWriteStream.$(O) \
+    $(OUTDIR)Xtreams__SharedQueueReadStream.$(O) \
+    $(OUTDIR)Xtreams__SharedQueueWriteStream.$(O) \
+    $(OUTDIR)stx_goodies_xtreams_terminals.$(O) \
+    $(OUTDIR)Xtreams__FileReadStream.$(O) \
+    $(OUTDIR)extensions.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Makefile	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,19 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile:
+	$(TOP)/rules/stmkmf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BlockClosureGenerateStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,93 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#BlockClosureGenerateStream
+	instanceVariableNames:'process current contentsSpecies writing readingSemaphore
+		writingSemaphore closed'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BlockClosureGenerateStream comment:'Read stream on a one argument block, evaluates the block once for the life time of the stream. Once the block finishes execution, the stream is closed. The block is expected to write to the block argument, which will block exectuion until elements are read from the stream.
+{{{
+	"In this example, we have a -hard- loop, not using collection protocol, which will only run one element at a time."
+	[:out | 1 to: 10 do: [:i | out put: i]] reading read: 5.
+}}}
+{{{
+	"Fibonacci"
+	[:out | | a b x |
+	a := 0. b := 1.
+	[out put: a.
+	x := a.
+	a := b.
+	b := b + x] repeat] reading ++ 500; get.
+}}}
+
+Instance Variables
+	current	<Object>	the current element in the stream
+	closed	<Boolean>	true if the block has finished execution
+	contentsSpecies	<Class>	species for collections of elements of this stream
+	process	<Process>	the process executing the block
+	readingSemaphore	<Semaphore>	attempts to read will wait on this
+	writingSemaphore	<Semaphore>	attempts to write will wait on this, signaled when an attempt to read is performed
+
+'
+!
+
+
+!BlockClosureGenerateStream methodsFor:'accessing'!
+
+get
+	writingSemaphore signal.
+	closed ifTrue: [Incomplete zero raise].
+	readingSemaphore wait.
+	^current
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	| count |
+	count := 0.
+	[[count < anInteger] whileTrue:
+		[aSequenceableCollection at: startIndex + count put: self get.
+		count := count + 1]]
+			on: Incomplete do: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+	^anInteger
+! !
+
+!BlockClosureGenerateStream methodsFor:'initialize-release'!
+
+close
+	closed := true.
+	process terminate.
+	readingSemaphore signal
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+on: aBlockClosure
+	super on: aBlockClosure.
+	contentsSpecies := Array.
+	readingSemaphore := Semaphore new.
+	writingSemaphore := Semaphore new.
+	closed := false.
+	process :=
+		[aBlockClosure value: [:in |
+			writingSemaphore wait.
+			current := in.
+			readingSemaphore signal] writing.
+		closed := true] fork
+! !
+
+!BlockClosureGenerateStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BlockClosureReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,84 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#BlockClosureReadStream
+	instanceVariableNames:'contentsSpecies closeBlock'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BlockClosureReadStream comment:'Read stream on a zero argument block, evaluates the block once for each requested element, the result of the block evaluation is the element.
+{{{
+	"inifinite stream of ones"
+	[ 1 ] reading read: 20
+}}}
+{{{
+	"Fibonacci"
+	| a b | a := 0. b := 1.
+	[ | x | x := a. a := b. b := x + a. x ] reading ++ 500; get
+}}}
+{{{
+	"Streaming over ObjectMemory"
+	x := ObjectMemory someObject.
+	[ x := ObjectMemory nextObjectAfter: x ] reading read: 5
+}}}
+
+Instance Variables
+	contentsSpecies	<Class> species for collections of elements of this stream
+	closeBlock	<BlockClosure> invoked in response to the #close message, allows customizing the close behavior
+
+'
+!
+
+
+!BlockClosureReadStream methodsFor:'accessing'!
+
+get
+	^source value
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	| count |
+	count := 0.
+	[[count < anInteger] whileTrue:
+		[aSequenceableCollection at: startIndex + count put: source value.
+		count := count + 1]]
+			on: Incomplete do: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+	^anInteger
+! !
+
+!BlockClosureReadStream methodsFor:'initialize-release'!
+
+close
+	closeBlock cull: self
+!
+
+closeBlock
+	^closeBlock
+!
+
+closeBlock: aBlock
+	closeBlock := aBlock
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: anObject
+	contentsSpecies := anObject
+!
+
+on: aBlockClosure
+	super on: aBlockClosure.
+	contentsSpecies := Array.
+	closeBlock := []
+! !
+
+!BlockClosureReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BlockClosureWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,77 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#BlockClosureWriteStream
+	instanceVariableNames:'contentsSpecies closeBlock'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BlockClosureWriteStream comment:'Write stream on a single argument block, the block is evaluated for each element written with the element assigned as the argument of the evaluation.
+{{{
+	"Transcript as an xtream"
+	[ :x | Transcript nextPut: x ] writing write: ''Hello World!!''
+}}}
+{{{
+	"/dev/null"
+	[ :x | ] writing write: ''Hello World!!''
+}}}
+
+Instance Variables
+	contentsSpecies	<Class> species for collections of elements of this stream
+	closeBlock	<BlockClosure> invoked in response to the #close message, allows customizing the close behavior
+
+'
+!
+
+
+!BlockClosureWriteStream methodsFor:'accessing'!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	| count |
+	count := 0.
+	[[count < anInteger] whileTrue:
+		[destination value: (aSequenceableCollection at: startIndex + count).
+		count := count + 1]]
+			on: Incomplete do: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+	^anInteger
+! !
+
+!BlockClosureWriteStream methodsFor:'initialize-release'!
+
+close
+	closeBlock cull: self
+!
+
+closeBlock
+	^closeBlock
+!
+
+closeBlock: aBlock
+	closeBlock := aBlock
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: anObject
+	contentsSpecies := anObject
+!
+
+flush
+!
+
+on: aBlockClosure
+	super on: aBlockClosure.
+	contentsSpecies := Array.
+	closeBlock := []
+! !
+
+!BlockClosureWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BufferReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,93 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#BufferReadStream
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BufferReadStream comment:'Read stream on a Buffer. Usually used in tandem with a write stream to access buffer contents conveniently.
+{{{
+	buffer := ElasticBuffer on: String new.
+	bufferIn := buffer writing.
+	bufferOut := buffer reading.
+	100000 timesRepeat: [ bufferIn write: ''Hello World''. bufferOut read: 11 ].
+	buffer cacheSize  
+}}}
+'
+!
+
+
+!BufferReadStream methodsFor:'accessing'!
+
+get
+	^source get
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	source read: anInteger into: aSequenceableCollection at: startIndex.
+	^anInteger
+! !
+
+!BufferReadStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^source contentsSpecies
+! !
+
+!BufferReadStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := source readSkip: anInteger.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := (source readSkip: anInteger negated) negated.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+available
+	^source readSize
+!
+
+length
+	^source activeSize
+!
+
+position
+	^source readPosition
+!
+
+position: aPosition
+	| available |
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	available := aPosition min: source activeSize.
+	source readPosition: available.
+	available = aPosition ifTrue: [^aPosition ].
+	(Incomplete count: available) raise
+! !
+
+!BufferReadStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!BufferReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BufferWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,106 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#BufferWriteStream
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BufferWriteStream comment:'Write stream on a Buffer. Usually used in tandem with a read stream to access buffer contents conveniently.
+{{{
+	buffer := ElasticBuffer on: String new.
+	bufferIn := buffer writing.
+	bufferOut := buffer reading.
+	100000 timesRepeat: [ bufferIn write: ''Hello World''. bufferOut read: 11 ].
+	buffer cacheSize  
+}}}
+'
+!
+
+
+!BufferWriteStream methodsFor:'accessing'!
+
+insert: anInteger from: aSequenceableCollection at: startIndex
+	^destination insert: anInteger from: aSequenceableCollection at: startIndex
+!
+
+put: anObject
+	^destination put: anObject
+!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	^destination write: anInteger from: aSequenceableCollection at: startIndex
+! !
+
+!BufferWriteStream methodsFor:'initialize-release'!
+
+close
+	destination close
+!
+
+contentsSpecies
+	^destination contentsSpecies
+!
+
+flush
+! !
+
+!BufferWriteStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := destination writeSkip: anInteger.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := (destination writeSkip: anInteger negated) negated.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+available
+	^destination writeSize
+!
+
+length
+	^destination activeSize
+!
+
+position
+	^destination writePosition
+!
+
+position: aPosition
+	| available |
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	available := aPosition min: destination activeSize.
+	destination writePosition: available.
+	available = aPosition ifTrue: [^aPosition ].
+	(Incomplete count: available) raise
+!
+
+skip: anInteger
+	| count |
+	count := destination writeSkip: anInteger.
+	count ~= anInteger ifTrue: [(Incomplete count: count) raise]
+! !
+
+!BufferWriteStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!BufferWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__BufferedWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,78 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#BufferedWriteStream
+	instanceVariableNames:'buffer'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+BufferedWriteStream comment:'Wraps a stream and buffers output to it based on the size of the ring-buffer it has. This is useful for doing "burst" writing, where you know exactly when you can flush the stream. To force the buffer to the underlying stream, use #flush.
+
+Instance Variables
+	buffer  <RingBuffer>    a fixed size RingBuffer to buffer up output, released when it is full or #flush/#close is sent.
+
+'
+!
+
+
+!BufferedWriteStream class methodsFor:'instance creation'!
+
+on: aDestination bufferSize: bufferSize
+	^self new on: aDestination bufferSize: bufferSize
+! !
+
+!BufferedWriteStream methodsFor:'accessing'!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+
+	| count amount |
+	count := 0.
+	[[amount := buffer write: (buffer writeSize min: (anInteger - count)) from: aSequenceableCollection at: startIndex + count.
+	count := count + amount.
+	count < anInteger] whileTrue: [self flush]]
+		on: Incomplete do: [:exception | (Incomplete on: aSequenceableCollection count: count + exception count at: startIndex) raise].
+	^anInteger
+! !
+
+!BufferedWriteStream methodsFor:'initialize-release'!
+
+close
+	super close.
+	buffer recycle.
+	buffer := nil
+!
+
+contentsSpecies
+	^destination contentsSpecies
+!
+
+flush
+	destination write: buffer
+!
+
+on: aDestination bufferSize: bufferSize
+	buffer := RingBuffer new: bufferSize class: aDestination contentsSpecies.
+	super on: aDestination
+! !
+
+!BufferedWriteStream methodsFor:'printing'!
+
+streamingPrintOn: aStream
+	super streamingPrintOn: aStream.
+	aStream
+		write: ' buffered: ';
+		print: buffer writeSize.
+	buffer writeSize isZero ifTrue: [^self].
+	aStream
+		cr; tab;
+		print: buffer contentsPast
+! !
+
+!BufferedWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__CollectionWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,53 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#CollectionWriteStream
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+CollectionWriteStream comment:'Write stream on a sequenceable collection. The collection is grown automatically to accommodate any elements written. Closing a collection write stream will truncate the collection to the current stream position. This behavior is useful as a replacement for the traditional #contents message. The contents can be accessed with the #terminal message after the stream is closed.
+{{{
+	String new writing write: ''Hello World''; -- 6; close; terminal
+}}}
+
+Instance Variables
+	position	<Integer> current position of the stream
+	length	<Integer> number of valid elements in the destination
+
+'
+!
+
+
+!CollectionWriteStream methodsFor:'accessing'!
+
+put: anObject
+	destination add: anObject
+!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	startIndex to: startIndex + anInteger - 1 do: [:index |
+		destination add: (aSequenceableCollection at: index)].
+	^anInteger
+! !
+
+!CollectionWriteStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^destination species
+!
+
+flush
+! !
+
+!CollectionWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__ExternalReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,108 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#ExternalReadStream
+	instanceVariableNames:'cache cachePosition cacheDataSize'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+ExternalReadStream comment:'Used to read from BlockableIOAccessors (e.g sockets or pipes). Elements are read-ahead but only what''s available. This is a binary stream (produces bytes/ByteArrays).
+
+{{{
+	[ :in :out |
+		[	out writing write: ''Hello''; close.
+			in reading read: 5
+		] ensure: [ in close. out close ]
+	] valueWithArguments: SocketAccessor openPair
+}}}
+{{{
+	[ :in :out |
+		[	out writing write: ''Hello''; close.
+			in reading read: 5
+		] ensure: [ in close. out close ]
+	] valueWithArguments: OSSystemSupport concreteClass pipeAccessorClass openPair
+}}}
+
+Instance Variables
+	cache	<ByteArray | ByteString> read-ahead buffer
+	cachePosition	<SmallInteger> position in the buffer
+	cacheDataSize	<SmallInteger> size of valid data in the buffer
+
+'
+!
+
+
+!ExternalReadStream methodsFor:'accessing'!
+
+get
+	cachePosition < cacheDataSize ifFalse: [
+		cachePosition := 0.
+		cacheDataSize := (1 max: self bytesForRead) min: cache size.
+		cacheDataSize := source readInto: cache startingAt: 1 for: cacheDataSize.
+		cacheDataSize isZero ifTrue: [ self incompleteRead: Incomplete zero ] ].
+	^cache at: (cachePosition := cachePosition + 1)
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+
+	| index toRead |
+	anInteger isZero ifTrue: [^0].
+	index := startIndex.
+	toRead := anInteger.
+	[toRead > 0] whileTrue: [ | amount |
+		cachePosition < cacheDataSize ifFalse: [
+			cachePosition := 0.
+			cacheDataSize := (toRead max: self bytesForRead) min: cache size.
+			cacheDataSize := source readInto: cache startingAt: 1 for: cacheDataSize.
+			cacheDataSize isZero ifTrue: [ self incompleteRead: (Incomplete on: aSequenceableCollection count: anInteger - toRead at: startIndex) ] ].
+		amount := (cacheDataSize - cachePosition) min: toRead.
+		aSequenceableCollection replaceFrom: index to: index + amount - 1 with: cache startingAt: cachePosition + 1.
+		cachePosition := cachePosition + amount.
+		index := index + amount.
+		toRead := toRead - amount ].
+	^anInteger
+! !
+
+!ExternalReadStream methodsFor:'initialize-release'!
+
+close
+	super close.
+	cache recycle
+!
+
+contentsSpecies
+	^cache class
+!
+
+contentsSpecies: aClass
+	cache ifNotNil: [ cache recycle ].
+	cache := aClass newRecycledDefaultSize.
+	cachePosition := 0.
+	cacheDataSize := 0.
+!
+
+on: anAccessor
+	super on: anAccessor.
+	self contentsSpecies: ByteArray
+! !
+
+!ExternalReadStream methodsFor:'private'!
+
+bytesForRead
+
+	^source bytesForRead
+!
+
+incompleteRead: incomplete
+
+	incomplete raise
+! !
+
+!ExternalReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__ExternalWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,78 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#ExternalWriteStream
+	instanceVariableNames:'contentsSpecies'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+ExternalWriteStream comment:'Used to write to BlockableIOAccessors (e.g sockets or pipes). This is a binary stream (consumes bytes/ByteArrays).
+
+{{{
+	[ :in :out |
+		[	out writing write: ''Hello''; close.
+			in reading read: 5
+		] ensure: [ in close. out close ]
+	] valueWithArguments: SocketAccessor openPair
+}}}
+{{{
+	[ :in :out |
+		[	out writing write: ''Hello''; close.
+			in reading read: 5
+		] ensure: [ in close. out close ]
+	] valueWithArguments: OSSystemSupport concreteClass pipeAccessorClass openPair
+}}}
+
+Instance Variables
+	contentsSpecies	<Class> species for collections of elements of this stream
+
+'
+!
+
+
+!ExternalWriteStream methodsFor:'accessing'!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	| count wrote |
+	anInteger isZero ifTrue: [^0].
+	count := 0.
+	[count < anInteger] whileTrue:
+		[wrote := destination writeFrom: aSequenceableCollection startingAt: startIndex + count for: anInteger - count.
+		wrote isZero ifTrue: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+		count := count + wrote].
+	^anInteger
+! !
+
+!ExternalWriteStream methodsFor:'initialize-release'!
+
+close
+	destination isActive ifFalse: [^self].
+	destination close
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+flush
+	destination isActive ifFalse: [^self].
+	destination commit
+!
+
+on: anAccessor
+	super on: anAccessor.
+	contentsSpecies := ByteArray
+! !
+
+!ExternalWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__FileReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,122 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ExternalReadStream subclass:#FileReadStream
+	instanceVariableNames:'position'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+FileReadStream comment:'Reads from a file. The stream is usually created by sending #reading to a Filename. However the actual terminal is an IOAccessor. The original filename is accessible through the IOAccessor. The stream is binary and is naturally positionable.
+{{{
+	| file |
+	file := ObjectMemory imageName asFilename reading.
+	[ file read: 13 ] ensure: [ file close ]
+}}}
+As a convenience, sending #reading to a Filename of a directory will create a stream of all filenames in that directory.
+{{{
+	''/tmp'' asFilename reading rest
+}}}
+
+Instance Variables
+	position	<Integer> current position of the stream
+
+'
+!
+
+
+!FileReadStream methodsFor:'accessing'!
+
+get
+
+	| object |
+	object := super get.
+	position := position + 1.
+	^object
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+
+	super read: anInteger into: aSequenceableCollection at: startIndex.
+	position := position + anInteger.
+	^anInteger
+! !
+
+!FileReadStream methodsFor:'initialize-release'!
+
+on: anAccessor
+	super on: anAccessor.
+	position := 0
+! !
+
+!FileReadStream methodsFor:'private'!
+
+bytesForRead
+
+	"Ideally we'd ask for the fileSize and subtract that from our position, but calling #fileSize is a slow primitive"
+	^cache size
+!
+
+incompleteRead: incomplete
+
+	position := position + incomplete count.
+	super incompleteRead: incomplete.
+! !
+
+!FileReadStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available min: anInteger.
+	position := position + count.
+	source seekTo: position.
+	cacheDataSize := cachePosition := 0.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	source seekTo: position.
+	cacheDataSize := cachePosition := 0.
+	anInteger = count ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+length
+	^source fileSize
+!
+
+position
+	^position
+!
+
+position: aPosition
+
+	| available |
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	available := aPosition min: self length.
+	source seekTo: available.
+	position := available.
+	cacheDataSize := cachePosition := 0.
+	available = aPosition ifTrue: [^aPosition].
+	(Incomplete count: available) raise
+! !
+
+!FileReadStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!FileReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__FileWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,147 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#FileWriteStream
+	instanceVariableNames:'position isPositionable contentsSpecies'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+FileWriteStream comment:'Writes to a file. File write streams can be created via the usual #writing message or via #appending which opens the file in appending mode. In appending mode, you cannot position the stream before the end of the file contents, so you can never overwrite existing contents. In writing mode, the file will be truncated at stream''s current position when #close is called. To keep the entire contents of the file, use -= 0 to skip to the end before closing. This behavior is different from the classic streams which would erase the contents of the file on opening. The stream is binary and naturally positionable.
+{{{
+	| file |
+	file := ''/dev/shm/xtreams-test'' asFilename.
+	[	file writing write: ''Hello''; close.
+		file appending write: '' World!!''; close.
+		file contentsOfEntireFile.
+	] ensure: [ file delete ]
+}}}
+It is also possible to send #reading or #writing to a pre-opened IOAcccessor if some other opening mode configuration is desirable. For example to emulate the classic write stream opening behavior, you can use the following:
+{{{
+	(IOAccessor openFileNamed: ''/dev/shm/xtreams-test'' 
+		direction: IOAccessor writeOnly
+		creation: IOAccessor truncateOrCreate
+	) writing close
+}}}
+
+Instance Variables
+	position	<Integer> current position of the stream
+	isPositionable	<Boolean> indicates that the file is open in append mode
+	contentsSpecies	<Class> species for collections of elements of this stream
+
+'
+!
+
+
+!FileWriteStream methodsFor:'accessing'!
+
+insert: anInteger from: aSequenceableCollection at: startIndex
+	^self shouldNotImplement.
+
+	"While it might seem desireable to be able to insert in to a file, the reality is you can only do so if you can read and write to the file. if you can read and write to the file, the fileSize becomes indeterminate. The only reasonable way to insert in to a file is to memory map it and access it with a PointerWriteStream instead."
+!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	| count wrote |
+	anInteger isZero ifTrue: [^0].
+	count := 0.
+	[count < anInteger] whileTrue:
+		[wrote := destination writeFrom: aSequenceableCollection startingAt: startIndex + count for: anInteger.
+		wrote isZero ifTrue: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+		count := count + wrote.
+		position := position + wrote].
+	^anInteger
+! !
+
+!FileWriteStream methodsFor:'initialize-release'!
+
+close
+	destination isActive ifFalse: [^self].
+	destination truncateTo: position.
+	destination close
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+flush
+	destination isActive ifFalse: [^self].
+	destination commit
+!
+
+isPositionable: aBoolean
+	"Only set to false when the file is open in append mode."
+
+	isPositionable := aBoolean
+!
+
+on: anAccessor
+	super on: anAccessor.
+	contentsSpecies := ByteArray.
+	isPositionable := true.
+	position := 0
+! !
+
+!FileWriteStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	self isPositionable ifFalse: [self error: 'This stream is not positionable.'].
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available min: anInteger.
+	position := position + count.
+	destination seekTo: position.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	self isPositionable ifFalse: [self error: 'This stream is not positionable.'].
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	destination seekTo: position.
+	anInteger = count ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+length
+	self isPositionable ifFalse: [self error: 'This stream is not positionable.'].
+	^destination fileSize
+!
+
+position
+	self isPositionable ifFalse: [self error: 'This stream is not positionable.'].
+	^position
+!
+
+position: aPosition
+	| available |
+	self isPositionable ifFalse: [self error: 'This stream is not positionable.'].
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	available := aPosition min: self length.
+	destination seekTo: available.
+	position := available.
+	available = aPosition ifTrue: [ ^aPosition ].
+	(Incomplete count: available) raise
+! !
+
+!FileWriteStream methodsFor:'testing'!
+
+isPositionable
+	^isPositionable
+! !
+
+!FileWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__NullWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,53 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#NullWriteStream
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+
+!NullWriteStream methodsFor:'accessing'!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	^anInteger
+! !
+
+!NullWriteStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^Array
+!
+
+flush
+! !
+
+!NullWriteStream methodsFor:'private'!
+
+streamingInsert: anInteger from: aReadStream
+	aReadStream ++ anInteger
+!
+
+streamingInsertFrom: aReadStream
+	aReadStream -= 0
+!
+
+streamingWrite: anInteger from: aReadStream
+	aReadStream ++ anInteger
+!
+
+streamingWriteFrom: aReadStream
+	aReadStream -= 0
+! !
+
+!NullWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__PointerReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,148 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#PointerReadStream
+	instanceVariableNames:'length contentsSpecies position'
+	classVariableNames:''
+	poolDictionaries:'External.CIntegerType.UnsignedChar'
+	category:'My Classes'
+!
+
+PointerReadStream comment:'Read stream on external heap, commonly used to unmarshal output or an external library call. The terminal is a CPointer and its associated CType is used to interpret the bytes on the heap. The length of the stream should be set, to avoid reading past the allocated memory space.
+{{{
+	| buffer |
+	buffer := CIntegerType unsignedChar malloc: 50.
+	[	buffer writing
+			length: 50;
+			write: ''Hello World!!''.
+		buffer reading
+			length: 12;
+			contentsSpecies: ByteString;
+			rest
+	] ensure: [ buffer free ]
+}}}
+
+Instance Variables
+	length	<Integer> allocated size of the stream as a number of elements of associated CType
+	contentsSpecies	<Class> species for collections of elements of this stream
+	position	<Integer> current position of the stream
+
+'
+!
+
+
+!PointerReadStream methodsFor:'accessing'!
+
+get
+	| object |
+	(length isNil or: [ position < length ]) ifFalse: [ Incomplete zero raise ].
+	object := source at: position.
+	position := position + 1.
+	^object
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	
+	| count |
+	count := self available ifNil: [ anInteger ] ifNotNil: [ :available | available min: anInteger ].
+	source type referentType = UnsignedChar
+		ifTrue: [ source copyAt: position to: aSequenceableCollection size: anInteger startingAt: startIndex. ]
+		ifFalse: [ startIndex to: startIndex + count - 1 do: [ :i | aSequenceableCollection at: i put: self get ] ].
+	position := position + count.
+	^count < anInteger
+		ifTrue: [ (Incomplete on: aSequenceableCollection count: count at: startIndex) raise ]
+		ifFalse: [ count ]
+! !
+
+!PointerReadStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+length: anObject
+	length := anObject
+!
+
+on: aPointer
+	super on: aPointer.
+	contentsSpecies := Array.
+	position := 0
+! !
+
+!PointerReadStream methodsFor:'private'!
+
+streamingInsertInto: aWriteStream
+	^length
+		ifNil: [ self error: 'Cannot stream from an unbounded stream' ]
+		ifNotNil: [ super streamingInsertInto: aWriteStream ]
+!
+
+streamingWriteInto: aWriteStream
+	^length
+		ifNil: [ self error: 'Cannot stream from an unbounded stream' ]
+		ifNotNil: [ super streamingWriteInto: aWriteStream ]
+! !
+
+!PointerReadStream methodsFor:'seeking'!
+
+++ anInteger
+
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available ifNil: [ anInteger ] ifNotNil: [ :available | available min: anInteger ].
+	position := position + anInteger.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+available
+
+	^self length ifNotNil: [ super available ]
+!
+
+length
+	^length
+!
+
+position
+	^position
+!
+
+position: aPosition
+
+	aPosition < 0 ifTrue: [Incomplete zero raise].
+	length ifNil: [ ^position := aPosition ].
+	aPosition > length ifFalse: [ ^position := aPosition ].
+	position := length.
+	^(Incomplete count: length) raise
+! !
+
+!PointerReadStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!PointerReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__PointerWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,169 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#PointerWriteStream
+	instanceVariableNames:'length position contentsSpecies'
+	classVariableNames:''
+	poolDictionaries:'External.CIntegerType.UnsignedChar OS'
+	category:'My Classes'
+!
+
+PointerWriteStream comment:'Write stream on external heap, commonly used to marshal input for an external library call. The terminal is a CPointer and its associated CType is used to interpret the bytes on the heap. The length of the stream must be set, to avoid writing past the allocated memory space. If more objects are written than can fit in the pre-allocated space, a new larger heap chunk is automatically allocated to accommodate it (the contents of the old chunk are copied over and the chunk is deallocated). Similarly closing the write stream will reallocate and shrink the write stream to its position at that time.
+{{{
+	| buffer |
+	buffer := CIntegerType unsignedChar malloc: 50.
+	[	buffer writing
+			length: 50;
+			write: ''Hello World!!''.
+		buffer reading
+			length: 12;
+			contentsSpecies: ByteString;
+			rest
+	] ensure: [ buffer free ]
+}}}
+
+Instance Variables
+	length	<Integer> allocated size of the stream as a number of elements of associated CType
+	position	<Integer> current position of the stream
+	contentsSpecies	<Class> species for collections of elements of this stream
+
+'
+!
+
+
+!PointerWriteStream methodsFor:'accessing'!
+
+contents
+	| cache |
+	cache := self contentsSpecies withSize: position.
+	destination copyAt: 0 to: cache size: position startingAt: 1.
+	^cache
+!
+
+insert: anInteger from: aSequenceableCollection at: startIndex
+	| shift |
+	shift := length - position.
+	self resizeTo: length + anInteger.
+	OSSystemSupport concreteClass new copyMemoryTo: destination + position + anInteger from: destination + position size: shift.
+	self copyFrom: aSequenceableCollection size: anInteger startingAt: startIndex.
+	position := position + anInteger.
+	^anInteger
+!
+
+put: anObject
+	| free |
+	free := length - position.
+	free < 1 ifTrue: [self resizeTo: length + 1].
+	destination at: position put: anObject.
+	position := position + 1
+!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	| available |
+	available := length - position.
+	available < anInteger ifTrue: [self resizeTo: length + anInteger - available].
+	self copyFrom: aSequenceableCollection size: anInteger startingAt: startIndex.
+	position := position + anInteger.
+	^anInteger
+! !
+
+!PointerWriteStream methodsFor:'initialize-release'!
+
+close
+	self resizeTo: position
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+flush
+!
+
+length: anObject
+	length := anObject
+!
+
+on: aPointer
+	super on: aPointer.
+	contentsSpecies := Array.
+	length := 1.
+	position := 0
+! !
+
+!PointerWriteStream methodsFor:'private'!
+
+copyFrom: aSequenceableCollection size: anInteger startingAt: startIndex
+
+	destination type = UnsignedChar
+		ifTrue: [ 	destination copyAt: position from: aSequenceableCollection size: anInteger startingAt: startIndex. ]
+		ifFalse: [
+			0 to: anInteger - 1 do: [ :i |
+				destination at: position + i put: (aSequenceableCollection at: startIndex + i) ] ]
+!
+
+resizeTo: anInteger
+	| replacement beGC |
+	length = anInteger ifTrue: [^self].
+	replacement := destination type baseReferentType malloc: anInteger.
+	OSSystemSupport concreteClass new copyMemoryTo: replacement from: destination size: (length min: anInteger).
+	beGC := CPointer.GarbageCollectablePointers includes: destination.
+	destination free.
+	destination referentAddress: replacement referentAddress.
+	beGC ifTrue: [destination beGarbageCollectable].
+	length := anInteger
+! !
+
+!PointerWriteStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available min: anInteger.
+	position := position + count.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+length
+	^length
+!
+
+position
+	^position
+!
+
+position: aPosition
+	" Return to a bookmarked position on this stream. "
+
+	aPosition < 0 ifTrue: [Incomplete zero raise].
+	aPosition > length ifFalse: [ ^position := aPosition ].
+	position := length.
+	^(Incomplete count: length) raise
+! !
+
+!PointerWriteStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!PointerWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__SequenceableCollectionReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,159 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#SequenceableCollectionReadStream
+	instanceVariableNames:'position'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+SequenceableCollectionReadStream comment:'Read stream on a sequenceable collection.
+{{{
+	(1 to: 10000) reading ++ 1000; read: 5
+}}}
+
+Instance Variables
+	position	<Integer> current position of the stream
+
+'
+!
+
+
+!SequenceableCollectionReadStream methodsFor:'accessing'!
+
+get
+	position = source size ifTrue: [Incomplete zero raise].
+	position := position + 1.
+	^source at: position
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	| count |
+	count := anInteger min: self available.
+	aSequenceableCollection replaceFrom: startIndex to: startIndex + count - 1 with: source startingAt: position + 1.
+	position := position + count.
+	count < anInteger ifTrue: [(Incomplete on: aSequenceableCollection count: count at: startIndex) raise].
+	^anInteger
+! !
+
+!SequenceableCollectionReadStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^source species
+!
+
+on: aSequenceableCollection
+	super on: aSequenceableCollection.
+	position := 0
+! !
+
+!SequenceableCollectionReadStream methodsFor:'printing'!
+
+streamingPrintOn: aStream
+	| tail head |
+	super streamingPrintOn: aStream.
+	tail := position min: 5.
+	head := (source size - position) min: (10 - tail).
+	aStream
+		write: ' position: ';
+		print: position;
+		write: ' size: ';
+		print: source size;
+		cr; tab;
+		write: (position > 5 ifTrue: ['...'] ifFalse: ['']);
+		print: (source copyFrom: position + 1 - tail to: position);
+		write: '  |  ';
+		print: (source copyFrom: position + 1 to: position + head);
+		write: (source size - position > (10 - tail) ifTrue: ['...'] ifFalse: [''])
+! !
+
+!SequenceableCollectionReadStream methodsFor:'private'!
+
+streamingInsert: anInteger into: aWriteStream
+	| count |
+	anInteger isZero ifTrue: [^self].
+	count := anInteger min: self available.
+	aWriteStream insert: count from: source at: position + 1.
+	position := position + count.
+	count >= anInteger ifTrue: [^self].
+	(Incomplete on: source count: count at: position - count + 1) raise
+!
+
+streamingInsertInto: aWriteStream
+	| count |
+	(count := self available) isZero ifTrue: [Incomplete zero raise].
+	self streamingInsert: count into: aWriteStream.
+	^count
+!
+
+streamingWrite: anInteger into: aWriteStream
+	| count |
+	anInteger isZero ifTrue: [^0].
+	count := anInteger min: self available.
+	aWriteStream write: count from: source at: position + 1.
+	position := position + count.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete on: source count: count at: position - count + 1) raise
+!
+
+streamingWriteInto: aWriteStream
+	| count |
+	(count := self available) isZero ifTrue: [^self].
+	self streamingWrite: count into: aWriteStream.
+	^count
+! !
+
+!SequenceableCollectionReadStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available min: anInteger.
+	position := position + count.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+length
+	^source size
+!
+
+position
+	" Return a bookmark for the current stream state. "
+
+	^position
+!
+
+position: aPosition
+
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	position := aPosition min: self length.
+	position = aPosition ifTrue: [^aPosition ].
+	(Incomplete count: position) raise
+! !
+
+!SequenceableCollectionReadStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!SequenceableCollectionReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__SequenceableCollectionWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,189 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#SequenceableCollectionWriteStream
+	instanceVariableNames:'position length'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+SequenceableCollectionWriteStream comment:'Write stream on a sequenceable collection. The collection is grown automatically to accommodate any elements written. Closing a collection write stream will truncate the collection to the current stream position. This behavior is useful as a replacement for the traditional #contents message. The contents can be accessed with the #terminal message after the stream is closed.
+{{{
+	String new writing write: ''Hello World''; -- 6; close; terminal
+}}}
+
+Instance Variables
+	position	<Integer> current position of the stream
+	length	<Integer> number of valid elements in the destination
+
+'
+!
+
+
+!SequenceableCollectionWriteStream methodsFor:'accessing'!
+
+contents
+	^destination copyFrom: 1 to: position
+!
+
+insert: anInteger from: aSequenceableCollection at: startIndex
+        destination := destination copyGrownToAtLeast: destination size + anInteger.
+        destination replaceFrom: position + anInteger + 1 to: length + anInteger with: destination startingAt: position + 1.
+        destination replaceFrom: position + 1 to: position + anInteger with: aSequenceableCollection startingAt: startIndex.
+        position := position + anInteger.
+        length := length + anInteger.
+        ^anInteger
+!
+
+put: anObject
+        | free |
+        free := destination size - position.
+        free < 1 ifTrue: [destination := destination copyGrownToAtLeast: destination size + 1].
+        position := position + 1.
+        destination at: position put: anObject.
+        length := length + 1.
+        ^anObject
+!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+        | available |
+        available := destination size - position.
+        available < anInteger ifTrue: [destination := destination copyGrownToAtLeast: destination size + anInteger - available].
+        destination replaceFrom: position + 1 to: position + anInteger with: aSequenceableCollection startingAt: startIndex.
+        position := position + anInteger.
+        position > length ifTrue: [length := position].
+        ^anInteger
+! !
+
+!SequenceableCollectionWriteStream methodsFor:'initialize-release'!
+
+close
+        destination := destination copyFrom: 1 to: position
+!
+
+contentsSpecies
+	^destination species
+!
+
+flush
+!
+
+on: aSequenceableCollection
+	super on: aSequenceableCollection.
+	position := 0.
+	length := 0
+! !
+
+!SequenceableCollectionWriteStream methodsFor:'printing'!
+
+streamingPrintOn: aStream
+	| tail head |
+	super streamingPrintOn: aStream.
+	tail := position min: 5.
+	head := (destination size - position) min: (10 - tail).
+	aStream
+		write: ' position: ';
+		print: position;
+		write: ' size: ';
+		print: destination size;
+		cr; tab;
+		write: (position > 5 ifTrue: ['...'] ifFalse: ['']);
+		print: (destination copyFrom: position + 1 - tail to: position);
+		write: '  |  ';
+		print: (destination copyFrom: position + 1 to: position + head);
+		write: (destination size - position > (10 - tail) ifTrue: ['...'] ifFalse: [''])
+! !
+
+!SequenceableCollectionWriteStream methodsFor:'private'!
+
+streamingInsert: anInteger from: aStreamable
+        | reading |
+        reading := aStreamable reading.
+        destination := destination copyGrownToAtLeast: destination size + anInteger.
+        destination replaceFrom: position + anInteger to: destination size with: destination startingAt: position.
+        [reading read: anInteger into: destination at: position + 1]
+                on: Incomplete do: [:error | position := position + error count. error pass].
+        position := position + anInteger
+!
+
+streamingInsertFrom: aStreamable
+	self error: 'Not Yet Implemented'
+!
+
+streamingWrite: anInteger from: aReadStream
+        | available |
+        available := destination size - position.
+        available < anInteger ifTrue: [destination := destination copyGrownToAtLeast: destination size + anInteger - available].
+        [aReadStream read: anInteger into: destination at: position + 1]
+                on: Incomplete do: [:error |
+                        position := position + error count.
+                        position > length ifTrue: [length := position].
+                        error pass].
+        position := position + anInteger.
+        position > length ifTrue: [length := position].
+        ^anInteger
+!
+
+streamingWriteFrom: aReadStream
+        | available count chunkSize |
+        count := 0.
+        chunkSize := DefaultBufferSize.
+        ^[[available := destination size - position.
+        available < chunkSize ifTrue: [destination := destination copyGrownToAtLeast: destination size + chunkSize].
+        aReadStream read: chunkSize into: destination at: position + 1.
+        position := position + chunkSize.
+        count := count + chunkSize] repeat]
+                on: Incomplete do: [:exception |
+                        position := position + exception count.
+                        position > length ifTrue: [length := position].
+                        count + exception count]
+! !
+
+!SequenceableCollectionWriteStream methodsFor:'seeking'!
+
+++ anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self -- anInteger negated ].
+	count := self available min: anInteger.
+	position := position + count.
+	count < anInteger ifTrue: [(Incomplete count: count) raise].
+	^anInteger
+!
+
+-- anInteger
+	| count |
+	anInteger < 0 ifTrue: [ ^self ++ anInteger negated ].
+	count := position min: anInteger.
+	position := position - count.
+	count = anInteger ifTrue: [^anInteger].
+	(Incomplete count: count) raise
+!
+
+length
+	^length
+!
+
+position
+	^position
+!
+
+position: aPosition
+	aPosition < 0 ifTrue: [ Incomplete zero raise ].
+	position := aPosition min: self length.
+	position = aPosition ifTrue: [^aPosition].
+	(Incomplete count: position) raise
+! !
+
+!SequenceableCollectionWriteStream methodsFor:'testing'!
+
+isPositionable
+	^true
+! !
+
+!SequenceableCollectionWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__SharedQueueReadStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,84 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+ReadStream subclass:#SharedQueueReadStream
+	instanceVariableNames:'contentsSpecies'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+SharedQueueReadStream comment:'Read stream on a SharedQueue. Primarily used for data transfer between processes.
+{{{
+	queue := SharedQueue new.
+	in := queue reading.
+	out := queue writing.
+	received := Array new writing.
+	done := Semaphore new.
+	consumer :=	
+		[ | size |
+			[	(size := in get) isZero
+			] whileFalse: [ | word |
+				word := ByteString new: size.
+				in read: size into: word.
+				received put: word ].
+			done signal.
+		] fork.
+	#(one two three four) do: [ :word | out put: word size; write: word ].
+	out put: 0.
+	done wait.
+	received conclusion
+}}}
+
+Instance Variables
+	contentsSpecies	<Class> species for collections of elements of this stream
+
+'
+!
+
+
+!SharedQueueReadStream methodsFor:'accessing'!
+
+get
+	^source next
+!
+
+read: anInteger into: aSequenceableCollection at: startIndex
+	startIndex to: startIndex + anInteger - 1 do: [:index | aSequenceableCollection at: index put: source next].
+	^anInteger
+! !
+
+!SharedQueueReadStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+on: aSource
+	super on: aSource.
+	contentsSpecies := Array
+! !
+
+!SharedQueueReadStream methodsFor:'private'!
+
+streamingInsertInto: aWriteStream
+	self shouldNotImplement
+!
+
+streamingWriteInto: aWriteStream
+	self shouldNotImplement
+! !
+
+!SharedQueueReadStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/Xtreams__SharedQueueWriteStream.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,73 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+"{ NameSpace: Xtreams }"
+
+WriteStream subclass:#SharedQueueWriteStream
+	instanceVariableNames:'contentsSpecies'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'My Classes'
+!
+
+SharedQueueWriteStream comment:'Write stream on a SharedQueue. Primarily used for data transfer between processes.
+{{{
+	queue := SharedQueue new.
+	in := queue reading.
+	out := queue writing.
+	received := Array new writing.
+	done := Semaphore new.
+	consumer :=	
+		[ | size |
+			[	(size := in get) isZero
+			] whileFalse: [ | word |
+				word := ByteString new: size.
+				in read: size into: word.
+				received put: word ].
+			done signal.
+		] fork.
+	#(one two three four) do: [ :word | out put: word size; write: word ].
+	out put: 0.
+	done wait.
+	received conclusion
+}}}
+
+Instance Variables
+	contentsSpecies	<Class> species for collections of elements of this stream
+
+'
+!
+
+
+!SharedQueueWriteStream methodsFor:'accessing'!
+
+write: anInteger from: aSequenceableCollection at: startIndex
+	startIndex to: startIndex + anInteger - 1 do: [:index | destination nextPut: (aSequenceableCollection at: index)].
+	^anInteger
+! !
+
+!SharedQueueWriteStream methodsFor:'initialize-release'!
+
+close
+!
+
+contentsSpecies
+	^contentsSpecies
+!
+
+contentsSpecies: aClass
+	contentsSpecies := aClass
+!
+
+flush
+!
+
+on: aDestination
+	super on: aDestination.
+	contentsSpecies := Array
+! !
+
+!SharedQueueWriteStream class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/abbrev.stc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,19 @@
+Xtreams::BlockClosureGenerateStream Xtreams__BlockClosureGenerateStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::BlockClosureReadStream Xtreams__BlockClosureReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::BlockClosureWriteStream Xtreams__BlockClosureWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::BufferReadStream Xtreams__BufferReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::BufferWriteStream Xtreams__BufferWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::BufferedWriteStream Xtreams__BufferedWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::CollectionWriteStream Xtreams__CollectionWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::ExternalReadStream Xtreams__ExternalReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::ExternalWriteStream Xtreams__ExternalWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::FileWriteStream Xtreams__FileWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::NullWriteStream Xtreams__NullWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::PointerReadStream Xtreams__PointerReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::PointerWriteStream Xtreams__PointerWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::SequenceableCollectionReadStream Xtreams__SequenceableCollectionReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::SequenceableCollectionWriteStream Xtreams__SequenceableCollectionWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::SharedQueueReadStream Xtreams__SharedQueueReadStream stx:goodies/xtreams/terminals 'My Classes' 0
+Xtreams::SharedQueueWriteStream Xtreams__SharedQueueWriteStream stx:goodies/xtreams/terminals 'My Classes' 0
+stx_goodies_xtreams_terminals stx_goodies_xtreams_terminals stx:goodies/xtreams/terminals '* Projects & Packages *' 3
+Xtreams::FileReadStream Xtreams__FileReadStream stx:goodies/xtreams/terminals 'My Classes' 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/autopackage/default.apspec	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,85 @@
+# -*- shell-script -*-
+[Meta]
+ShortName: 
+SoftwareVersion: 6.2.1.1
+DisplayName: Smalltalk/X Class library
+RootName: @exept.de/expecco:$SOFTWAREVERSION
+Summary: Smalltalk/X Class library
+Maintainer: eXept Software AG
+Packager: eXept Software AG
+PackageVersion: 1
+CPUArchitectures: x86
+AutopackageTarget: 1.0
+Type: Library
+License: Commercial
+
+[Description]
+Smalltalk/X Class library
+
+[BuildPrepare]
+# If you're using autotools, the default should be enough.
+# prepareBuild will set up apbuild and run configure for you. If you
+# need to pass arguments to configure, just add them to prepareBuild:
+# prepareBuild --enable-foo --disable-bar
+#prepareBuild
+
+[BuildUnprepare]
+# If you're using prepareBuild above, there is no need to change this!
+#unprepareBuild
+
+[Globals]
+# Variables declared in this section will be available in all other sections
+export APKG_BUILD_SKIP_CONFIGURE=1
+export APKG_BUILD_SKIP_MAKE=1
+export MYPREFIX=/opt/
+
+[Prepare]
+#recommend '@autopackage.org/autopackage-gtk' 1
+
+[Imports]
+import <<EOF
+$source_dir/
+$source_dir/resources
+$source_dir/keyboard.rc
+$source_dir/display.rc
+$source_dir/../doc
+$source_dir/../testsuites/webedition
+$source_dir/../projects/libraries
+$source_dir/../reportGenerator/tools
+$source_dir/../../pdf/afm
+$source_dir/../plugin/selenium/libexept_expecco_plugin_selenium.so
+$source_dir/../externalTools
+EOF
+
+for i in $source_dir/*.so
+do
+    echo $source_dir/$(readlink $i)
+done | import
+
+[Install]
+if [ "$PREFIX" != "/usr" ]
+then
+    export MYPREFIX=$PREFIX
+fi
+
+find . -type d \( -name CVS -or -name 'not_*' \) -print | xargs rm -rf
+mkdir -p $MYPREFIX
+copyFiles expecco *.rc resources        $MYPREFIX/bin
+copyFiles *.so                          $MYPREFIX/lib
+copyFiles doc externalTools             $MYPREFIX/packages/exept/expecco
+copyFiles webedition/projects libraries $MYPREFIX/testsuites
+copyFiles tools                         $MYPREFIX/packages/exept/expecco/reportGenerator
+copyFiles afm                           $MYPREFIX/packages/exept/pdf
+copyFiles libexept_expecco_plugin_selenium.so   $MYPREFIX/plugin
+
+#installExe expecco
+#installLib *.so
+#installData resources
+#installData keyboard.rc
+#installData doc
+
+[Uninstall]
+# Leaving this at the default is safe unless you use custom commands in
+# "Install" to create files. All autopackage API functions
+# that installs files are logged.
+uninstallFromLog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/bc.mak	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,89 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains make rules for the win32 platform (using borland-bcc).
+# It shares common definitions with the unix-make in Make.spec.
+# The nt.mak supports the following targets:
+#    bmake         - compile all st-files to a classLib (dll)
+#    bmake clean   - clean all temp files
+#    bmake clobber - clean all
+#
+#
+TOP=..\..\..
+INCLUDE_TOP=$(TOP)\..
+
+
+
+!INCLUDE $(TOP)\rules\stdHeader_bc
+
+!INCLUDE Make.spec
+
+LIBNAME=libstx_goodies_xtreams_terminals
+RESFILES=terminals.res
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\goodies\xtreams\core -I$(INCLUDE_TOP)\stx\libcompat -I$(INCLUDE_TOP)\stx\libbasic
+LOCALDEFINES=
+
+STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -H. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
+LOCALLIBS=
+
+OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
+
+ALL::  classLibRule
+
+classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
+
+!INCLUDE $(TOP)\rules\stdRules_bc
+
+# build all prerequisite packages for this package
+prereq:
+	pushd ..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\core & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libboss & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libwidg3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\libcompat & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\librun & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)Xtreams__BlockClosureGenerateStream.$(O) Xtreams__BlockClosureGenerateStream.$(H): Xtreams__BlockClosureGenerateStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BlockClosureReadStream.$(O) Xtreams__BlockClosureReadStream.$(H): Xtreams__BlockClosureReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BlockClosureWriteStream.$(O) Xtreams__BlockClosureWriteStream.$(H): Xtreams__BlockClosureWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferReadStream.$(O) Xtreams__BufferReadStream.$(H): Xtreams__BufferReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferWriteStream.$(O) Xtreams__BufferWriteStream.$(H): Xtreams__BufferWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__BufferedWriteStream.$(O) Xtreams__BufferedWriteStream.$(H): Xtreams__BufferedWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__CollectionWriteStream.$(O) Xtreams__CollectionWriteStream.$(H): Xtreams__CollectionWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__ExternalReadStream.$(O) Xtreams__ExternalReadStream.$(H): Xtreams__ExternalReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__ExternalWriteStream.$(O) Xtreams__ExternalWriteStream.$(H): Xtreams__ExternalWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__FileWriteStream.$(O) Xtreams__FileWriteStream.$(H): Xtreams__FileWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__NullWriteStream.$(O) Xtreams__NullWriteStream.$(H): Xtreams__NullWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__PointerReadStream.$(O) Xtreams__PointerReadStream.$(H): Xtreams__PointerReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__PointerWriteStream.$(O) Xtreams__PointerWriteStream.$(H): Xtreams__PointerWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SequenceableCollectionReadStream.$(O) Xtreams__SequenceableCollectionReadStream.$(H): Xtreams__SequenceableCollectionReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SequenceableCollectionWriteStream.$(O) Xtreams__SequenceableCollectionWriteStream.$(H): Xtreams__SequenceableCollectionWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SharedQueueReadStream.$(O) Xtreams__SharedQueueReadStream.$(H): Xtreams__SharedQueueReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__SharedQueueWriteStream.$(O) Xtreams__SharedQueueWriteStream.$(H): Xtreams__SharedQueueWriteStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)stx_goodies_xtreams_terminals.$(O) stx_goodies_xtreams_terminals.$(H): stx_goodies_xtreams_terminals.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Xtreams__FileReadStream.$(O) Xtreams__FileReadStream.$(H): Xtreams__FileReadStream.st $(INCLUDE_TOP)\stx\goodies\xtreams\terminals\Xtreams__ExternalReadStream.$(H) $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__ReadStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\Block.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Filename.$(H) $(INCLUDE_TOP)\stx\libbasic2\Random.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic2\SharedQueue.$(H) $(INCLUDE_TOP)\stx\libbasic2\Queue.$(H) $(INCLUDE_TOP)\stx\libbasic2\Socket.$(H) $(INCLUDE_TOP)\stx\libbasic\NonPositionableExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ReadWriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PositionableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libwidg\TextCollector.$(H) $(INCLUDE_TOP)\stx\libwidg\EditTextView.$(H) $(INCLUDE_TOP)\stx\libwidg\TextView.$(H) $(INCLUDE_TOP)\stx\libwidg\ListView.$(H) $(INCLUDE_TOP)\stx\libview\View.$(H) $(INCLUDE_TOP)\stx\libview\SimpleView.$(H) $(INCLUDE_TOP)\stx\libview\DisplaySurface.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsMedium.$(H) $(INCLUDE_TOP)\stx\libview\DeviceGraphicsContext.$(H) $(INCLUDE_TOP)\stx\libview\GraphicsContext.$(H) $(INCLUDE_TOP)\stx\libbasic\UndefinedObject.$(H) $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__Buffer.$(H) $(INCLUDE_TOP)\stx\goodies\xtreams\core\Xtreams__WriteStream.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/bmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using borland bcc
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/extensions.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,135 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+!
+
+!Block methodsFor:'converting'!
+
+reading
+        self numArgs = 0 ifTrue: [^Xtreams::BlockClosureReadStream on: self].
+        self numArgs = 1 ifTrue: [^Xtreams::BlockClosureGenerateStream on: self].
+        self error: 'More arguments than we can poke a stick at!!'
+! !
+!Block methodsFor:'converting'!
+
+writing
+        self numArgs = 1 ifTrue: [^Xtreams::BlockClosureWriteStream on: self].
+        self error: 'Must be a single argument block.'
+! !
+!Collection methodsFor:'converting'!
+
+writing
+        ^Xtreams::CollectionWriteStream on: self
+! !
+!Filename methodsFor:'converting'!
+
+appending
+	^(IOAccessor openFileNamed: self direction: IOAccessor appendOnly creation: IOAccessor mayCreate) writing
+		position: self fileSize;
+		isPositionable: false;
+		yourself
+! !
+!Filename methodsFor:'converting'!
+
+reading
+	self isDirectory ifFalse: [^(IOAccessor openFileNamed: self direction: IOAccessor readOnly creation: IOAccessor noCreate) reading].
+
+	"Return the directory contents as a stream of filenames"
+	^([self directoryContents]
+		on:	self errorReporter errorSignal
+		do:	[:ex | ex return: #()])
+			reading collecting: [:each | self construct: each asFilename]
+! !
+!Filename methodsFor:'converting'!
+
+writing
+	^(IOAccessor openFileNamed: self direction: IOAccessor writeOnly creation: IOAccessor mayCreate) writing
+! !
+!Random methodsFor:'converting'!
+
+reading
+	^[self next] reading
+		contentsSpecies: self contentsSpecies;
+		yourself
+! !
+!SequenceableCollection methodsFor:'converting'!
+
+reading
+        ^Xtreams::SequenceableCollectionReadStream on: self
+! !
+!SequenceableCollection methodsFor:'converting'!
+
+writing
+        ^Xtreams::SequenceableCollectionWriteStream on: self
+! !
+!SharedQueue methodsFor:'converting'!
+
+reading
+        ^Xtreams::SharedQueueReadStream on: self
+! !
+!SharedQueue methodsFor:'converting'!
+
+writing
+        ^Xtreams::SharedQueueWriteStream on: self
+! !
+!Socket methodsFor:'converting'!
+
+accepting
+	"Return a read stream that produces new sockets from incoming connections."
+
+	"^	ReadStream"
+
+	"Listen for connections and close those connections immediately.
+	| socket |
+	socket := SocketAccessor newTCP.
+	socket listenFor: 1.
+	[socket acceping do: [:client | client close]]
+		ensure: [socket close]
+	"
+
+	^[self accept] reading
+		closeBlock: [self close];
+		yourself
+! !
+!Socket methodsFor:'converting'!
+
+reading
+	^ExternalReadStream on: self
+! !
+!Socket methodsFor:'converting'!
+
+writing
+	^ExternalWriteStream on: self
+! !
+!TextCollector methodsFor:'converting'!
+
+writing
+	^[:object | self nextPut: object] writing
+! !
+!UndefinedObject methodsFor:'converting'!
+
+writing
+        ^Xtreams::NullWriteStream new
+! !
+!Xtreams::Buffer methodsFor:'converting'!
+
+reading
+	^BufferReadStream on: self
+! !
+!Xtreams::Buffer methodsFor:'converting'!
+
+writing
+	^BufferWriteStream on: self
+! !
+!Xtreams::WriteStream methodsFor:'transforming'!
+
+buffering: bufferSize
+	"Delays committing its content to its underlying stream until it has reached a certain size ,#flush is sent, or the stream is closed."
+	"       bufferSize      <Integer> The size of the buffer to start with.
+		^<PositionWriteStream>"
+	"
+		(ByteArray new writing buffering: 5)
+			write: (ByteArray withAll: (1 to: 11));
+			conclusion
+	"
+	^BufferedWriteStream on: self bufferSize: bufferSize
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/lcmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USELCC=1 %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/libInit.cc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,52 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_goodies_xtreams_terminals.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_goodies_xtreams_terminals_Init() INIT_TEXT_SECTION;
+// DLL_EXPORT void _libstx_goodies_xtreams_terminals_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+// void _libstx_goodies_xtreams_terminals_InitDefinition(pass, __pRT__, snd)
+// OBJ snd; struct __vmData__ *__pRT__; {
+// __BEGIN_PACKAGE2__("libstx_goodies_xtreams_terminals__DFN", _libstx_goodies_xtreams_terminals_InitDefinition, "stx:goodies/xtreams/terminals");
+// _stx_137goodies_137xtreams_137terminals_Init(pass,__pRT__,snd);
+
+// __END_PACKAGE__();
+// }
+
+void _libstx_goodies_xtreams_terminals_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_xtreams_terminals", _libstx_goodies_xtreams_terminals_Init, "stx:goodies/xtreams/terminals");
+_Xtreams__BlockClosureGenerateStream_Init(pass,__pRT__,snd);
+_Xtreams__BlockClosureReadStream_Init(pass,__pRT__,snd);
+_Xtreams__BlockClosureWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__BufferReadStream_Init(pass,__pRT__,snd);
+_Xtreams__BufferWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__BufferedWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__CollectionWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__ExternalReadStream_Init(pass,__pRT__,snd);
+_Xtreams__ExternalWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__FileWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__NullWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__PointerReadStream_Init(pass,__pRT__,snd);
+_Xtreams__PointerWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__SequenceableCollectionReadStream_Init(pass,__pRT__,snd);
+_Xtreams__SequenceableCollectionWriteStream_Init(pass,__pRT__,snd);
+_Xtreams__SharedQueueReadStream_Init(pass,__pRT__,snd);
+_Xtreams__SharedQueueWriteStream_Init(pass,__pRT__,snd);
+_stx_137goodies_137xtreams_137terminals_Init(pass,__pRT__,snd);
+_Xtreams__FileReadStream_Init(pass,__pRT__,snd);
+
+_stx_137goodies_137xtreams_137terminals_extensions_Init(pass,__pRT__,snd);
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/stx_goodies_xtreams_terminals.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,149 @@
+"{ Package: 'stx:goodies/xtreams/terminals' }"
+
+LibraryDefinition subclass:#stx_goodies_xtreams_terminals
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_goodies_xtreams_terminals class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list all packages which should be ignored in the automatic
+     preRequisites scan. See #preRequisites for more."
+
+    ^ #(
+    )
+!
+
+preRequisites
+    "list all required packages.
+     This list can be maintained manually or (better) generated and
+     updated by scanning the superclass hierarchies and looking for
+     global variable accesses. (the browser has a menu function for that)
+     Howevery, often too much is found, and you may want to explicitely
+     exclude individual packages in the #excludedFromPrerequisites method."
+
+    ^ #(
+        #'stx:goodies/xtreams/core'    "Xtreams::WriteStream - superclass of Xtreams::SequenceableCollectionWriteStream "
+        #'stx:libbasic'    "Object - superclass of Xtreams::BufferReadStream "
+        #'stx:libcompat'    "IOAccessor - referenced by Filename>>reading "
+    )
+! !
+
+!stx_goodies_xtreams_terminals class methodsFor:'description - contents'!
+
+classNamesAndAttributes
+    "lists the classes which are to be included in the project.
+     Each entry in the list may be: a single class-name (symbol),
+     or an array-literal consisting of class name and attributes.
+     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
+
+    ^ #(
+        "<className> or (<className> attributes...) in load order"
+        #'Xtreams::BlockClosureGenerateStream'
+        #'Xtreams::BlockClosureReadStream'
+        #'Xtreams::BlockClosureWriteStream'
+        #'Xtreams::BufferReadStream'
+        #'Xtreams::BufferWriteStream'
+        #'Xtreams::BufferedWriteStream'
+        #'Xtreams::CollectionWriteStream'
+        #'Xtreams::ExternalReadStream'
+        #'Xtreams::ExternalWriteStream'
+        #'Xtreams::FileWriteStream'
+        #'Xtreams::NullWriteStream'
+        #'Xtreams::PointerReadStream'
+        #'Xtreams::PointerWriteStream'
+        #'Xtreams::SequenceableCollectionReadStream'
+        #'Xtreams::SequenceableCollectionWriteStream'
+        #'Xtreams::SharedQueueReadStream'
+        #'Xtreams::SharedQueueWriteStream'
+        #'stx_goodies_xtreams_terminals'
+        #'Xtreams::FileReadStream'
+    )
+!
+
+extensionMethodNames
+    "lists the extension methods which are to be included in the project.
+     Entries are 2-element array literals, consisting of class-name and selector."
+
+    ^ #(
+        Block reading
+        Block writing
+        Collection writing
+        Filename appending
+        Filename reading
+        Filename writing
+        Random reading
+        SequenceableCollection reading
+        SequenceableCollection writing
+        SharedQueue reading
+        SharedQueue writing
+        Socket accepting
+        Socket reading
+        Socket writing
+        TextCollector writing
+        UndefinedObject writing
+        #'Xtreams::Buffer' reading
+        #'Xtreams::Buffer' writing
+        #'Xtreams::WriteStream' buffering:
+    )
+! !
+
+!stx_goodies_xtreams_terminals class methodsFor:'description - project information'!
+
+applicationIconFileName
+    "Return the name (without suffix) of an icon-file (the app's icon); will be included in the rc-resource file"
+
+    ^ nil
+    "/ ^ self applicationName
+!
+
+companyName
+    "Return a companyname which will appear in <lib>.rc"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Return a description string which will appear in vc.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Return a copyright string which will appear in <lib>.rc"
+
+    ^ 'Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011'
+!
+
+productName
+    "Return a product name which will appear in <lib>.rc"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_goodies_xtreams_terminals class methodsFor:'description - svn'!
+
+svnRepositoryUrlString
+    "Return a SVN repository URL of myself.
+     (Generated since 2011-04-08)
+    "        
+
+    ^ '$URL$'
+!
+
+svnRevisionNr
+    "Return a SVN revision number of myself.
+     This number is updated after a commit"
+
+    ^ "$SVN-Revision:"'nil'"$"
+! !
+
+!stx_goodies_xtreams_terminals class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/terminals.rc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,35 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_goodies_xtreams_terminals.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     6,2,0,1
+  PRODUCTVERSION  6,2,1,1
+  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
+  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+  FILEOS          VOS_NT_WINDOWS32
+  FILETYPE        VFT_DLL
+  FILESUBTYPE     VS_USER_DEFINED
+
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "040904E4"
+    BEGIN
+      VALUE "CompanyName", "eXept Software AG\0"
+      VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
+      VALUE "FileVersion", "6.2.0.1\0"
+      VALUE "InternalName", "stx:goodies/xtreams/terminals\0"
+      VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
+      VALUE "ProductName", "Smalltalk/X\0"
+      VALUE "ProductVersion", "6.2.1.1\0"
+      VALUE "ProductDate", "Mon, 22 Aug 2011 16:04:03 GMT\0"
+    END
+
+  END
+
+  BLOCK "VarFileInfo"
+  BEGIN                               //  Language   |    Translation
+    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
+  END
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Make.proto	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,128 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# The Makefile as generated by this Make.proto supports the following targets:
+#    make         - compile all st-files to a classLib
+#    make clean   - clean all temp files
+#    make clobber - clean all
+#
+# This file contains definitions for Unix based platforms.
+# It shares common definitions with the win32-make in Make.spec.
+
+#
+# position (of this package) in directory hierarchy:
+# (must point to ST/X top directory, for tools and includes)
+TOP=../../../..
+INCLUDE_TOP=$(TOP)/..
+
+# subdirectories where targets are to be made:
+SUBDIRS=
+
+
+# subdirectories where Makefiles are to be made:
+# (only define if different from SUBDIRS)
+# ALLSUBDIRS=
+
+REQUIRED_SUPPORT_DIRS=
+
+# if your embedded C code requires any system includes,
+# add the path(es) here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALINCLUDES=-Ifoo -Ibar
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/xtreams/core/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/goodies/xtreams/core -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libbasic
+
+
+# if you need any additional defines for embedded C code,
+# add them here:,
+# ********** OPTIONAL: MODIFY the next lines ***
+# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
+LOCALDEFINES=
+
+LIBNAME=libstx_goodies_xtreams_terminals_tests
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -H.  -varPrefix=$(LIBNAME)
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C-libraries that should be pre-linked with the class-objects
+LD_OBJ_LIBS=
+LOCAL_SHARED_LIBS=
+
+
+# ********** OPTIONAL: MODIFY the next line ***
+# additional C targets or libraries should be added below
+LOCAL_EXTRA_TARGETS=
+
+OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
+
+
+
+all:: preMake classLibRule postMake
+
+pre_objs::  update-svn-revision
+
+
+
+update-svn-revision:
+	if [ ! -r .svnversion -o "$(shell svnversion -n)" != "$(shell cat .svnversion)" ]; then \
+		svnversion -n > .svnversion; \
+		sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"'$(shell svnversion -n)'\"\$$\"/g" \
+			stx_goodies_xtreams_terminals_tests.st; \
+	fi
+.PHONY: update-svn-revision
+
+
+# add more install actions here
+install::
+
+# add more install actions for aux-files (resources) here
+installAux::
+
+# add more preMake actions here
+preMake::
+
+# add more postMake actions here
+postMake:: cleanjunk
+
+prereq: $(REQUIRED_SUPPORT_DIRS)
+	cd ../../../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../refactoryBrowser/parser && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../core && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libboss && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libui && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libwidg2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libwidg3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libtool && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../libcompat && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../substreams && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../core/tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+	cd ../../../../librun && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
+
+
+
+cleanjunk::
+
+clean::
+	-rm -f *.o *.H
+
+clobber:: clean
+	-rm -f *.so *.dll
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)stx_goodies_xtreams_terminals_tests.$(O) stx_goodies_xtreams_terminals_tests.$(H): stx_goodies_xtreams_terminals_tests.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Make.spec	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,62 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains specifications which are common to all platforms.
+#
+
+# Do NOT CHANGE THESE DEFINITIONS
+# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
+#  to find the source code of a class and to find the library for a package)
+MODULE=stx
+MODULE_DIR=goodies/xtreams/terminals/tests
+PACKAGE=$(MODULE):$(MODULE_DIR)
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -H.         : create header files locally
+#                (if removed, they will be created as common
+#  -Pxxx       : defines the package
+#  -Zxxx       : a prefix for variables within the classLib
+#  -Dxxx       : defines passed to to CC for inline C-code
+#  -Ixxx       : include path passed to CC for inline C-code
+#  +optspace   : optimized for space
+#  +optspace2  : optimized more for space
+#  +optspace3  : optimized even more for space
+#  +optinline  : generate inline code for some ST constructs
+#  +inlineNew  : additionally inline new
+#  +inlineMath : additionally inline some floatPnt math stuff
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
+# STCLOCALOPTIMIZATIONS=+optspace3
+STCLOCALOPTIMIZATIONS=+optspace3
+
+
+# Argument(s) to the stc compiler (stc --usage).
+#  -warn            : no warnings
+#  -warnNonStandard : no warnings about ST/X extensions
+#  -warnEOLComments : no warnings about EOL comment extension
+#  -warnPrivacy     : no warnings about privateClass extension
+#
+# ********** OPTIONAL: MODIFY the next line(s) ***
+# STCWARNINGS=-warn
+# STCWARNINGS=-warnNonStandard
+# STCWARNINGS=-warnEOLComments
+STCWARNINGS=-warnNonStandard
+
+COMMON_CLASSES= \
+	stx_goodies_xtreams_terminals_tests \
+
+
+
+
+COMMON_OBJS= \
+    $(OUTDIR)stx_goodies_xtreams_terminals_tests.$(O) \
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Makefile	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,19 @@
+#
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
+#
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
+include Make.proto
+
+makefile:
+	$(TOP)/rules/stmkmf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__BlockClosureReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,28 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#BlockClosureReadingWritingTest
+	instanceVariableNames:'collection'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!BlockClosureReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	collection := OrderedCollection new.
+	input := [ collection isEmpty ifTrue: [ Incomplete zero raise ]. collection removeFirst ] reading.
+	input contentsSpecies: ByteArray.
+	output := [ :x | collection addLast: x ] writing.
+	output contentsSpecies: ByteArray.
+! !
+
+!BlockClosureReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__BlockClosureTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,26 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+TestCase subclass:#BlockClosureTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!BlockClosureTest methodsFor:'tests'!
+
+testOneArgumentReading
+	self assert:
+		([:out | 1 to: 10 do: [:i | out put: i]] reading
+			contentsSpecies: ByteArray;
+			read: 5) = #[ 1 2 3 4 5 ]
+! !
+
+!BlockClosureTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__BufferReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,26 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#BufferReadingWritingTest
+	instanceVariableNames:'buffer'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!BufferReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	buffer := Buffer on: ByteArray new.
+	input := buffer reading.
+	output := buffer writing.
+! !
+
+!BufferReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__BufferedWriteStreamTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,39 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+TestCase subclass:#BufferedWriteStreamTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!BufferedWriteStreamTest methodsFor:'tests'!
+
+testBuffered
+	| writing |
+	writing := ByteArray new writing buffering: 10.
+	writing write: #[ 1 2 3 4 5 ].
+	self deny: (writing terminal first: 5) = #[ 1 2 3 4 5 ].
+	writing write: #[ 6 7 8 9 ].
+	self deny: (writing terminal first: 9) = #[ 1 2 3 4 5 6 7 8 9 ].
+	writing put: 0.
+	self deny: (writing terminal first: 10) = #[ 1 2 3 4 5 6 7 8 9 0 ].
+	writing write: #[ 11 12 ].
+	self assert: (writing terminal first: 10) = #[ 1 2 3 4 5 6 7 8 9 0 ].
+	self deny: (writing terminal first: 12) = #[ 1 2 3 4 5 6 7 8 9 0 11 12 ].
+	writing flush.
+	self assert: (writing terminal first: 12) = #[ 1 2 3 4 5 6 7 8 9 0 11 12 ].
+	writing write: #[ 13 14 ].
+	self deny: (writing terminal first: 14) = #[ 1 2 3 4 5 6 7 8 9 0 11 12 13 14 ].
+	writing close.
+	self assert: (writing terminal first: 14) = #[ 1 2 3 4 5 6 7 8 9 0 11 12 13 14 ].
+! !
+
+!BufferedWriteStreamTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__CollectionReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,77 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#CollectionReadingWritingTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!CollectionReadingWritingTest methodsFor:'initialize-release'!
+
+input
+
+	^input ifNil: [ input := (self output close; terminal) reading ]
+!
+
+output
+
+	^output ifNil: [ output := ByteArray new writing ]
+! !
+
+!CollectionReadingWritingTest methodsFor:'tests - core'!
+
+testInsert
+	self output write: #[ 1 2 3 4 7 8 9 0 ].
+	self output -- 4.
+	self output insert: #[ 5 6 ].
+	self output -= 0. "Have to seek to the end otherwise output gets truncated when we close it"
+	self assert: (self input read: 10) = #[ 1 2 3 4 5 6 7 8 9 0 ]
+!
+
+testReadWriteLargeAmount
+        | data |
+    1 to: 10 do: [:each | 
+        output := input := nil.
+        self output put: 1. self assert: self input get = 1].
+       #( 64 1024 2048 4096 8192 ) do: [:dataSize |
+                output := input := nil.
+                data := ByteArray new: dataSize.
+                1 to: data size do: [:i | data at: i put: (i - 1) \\ 256].
+                self    timeout:        1000 milliseconds
+                        server:         [1 to: 10 do: [:each | self output write: data]. true]
+                        client:         [(1 to: 10) inject: true into: [:pass :each | pass and: [(self input read: data size) = data]]]]
+!
+
+testWriteFromCollectionAt
+
+	| data |
+	data := #[1 2 3 4 5 6 7].
+	self assert: (self output write: 4 from: data at: 1) = 4.
+	self assert: (self output write: 3 from: data at: 5) = 3.
+	self assert: (self input read: 4) = (data first: 4).
+	self assert: (self input read: 3) = (data last: 3)
+!
+
+testWriteFromStream
+	| data |
+	data := #[ 1 2 3 4 ] reading.
+	self assert: (self output write: 3 from: data) = 3.
+	self assert: (self output write: 1 from: data) = 1.
+	self assert: (self input read: 3) = #[ 1 2 3 ].
+	self assert: self input get = 4.
+	self assert: (
+		[	self output write: 2 from: data. false
+		] on: Incomplete do: [ :eos |
+			eos count = 0 ])
+! !
+
+
+!CollectionReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__ElasticBufferReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,26 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#ElasticBufferReadingWritingTest
+	instanceVariableNames:'buffer'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!ElasticBufferReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	buffer := ElasticBuffer on: ByteArray new.
+	input := buffer reading.
+	output := buffer writing.
+! !
+
+!ElasticBufferReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__FileReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,43 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#FileReadingWritingTest
+	instanceVariableNames:'file'
+	classVariableNames:''
+	poolDictionaries:'OS'
+	category:'Xtreams'
+!
+
+
+!FileReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	file := '<1s>-<2s>' expandMacrosWith: self class name with: testSelector.
+	file :=
+		(OSHandle currentOS = #unix and: [ '/dev/shm' asFilename exists ])
+			ifTrue: [ ('/dev/shm/', file) asFilename ]
+			ifFalse: [ file asFilename ].
+	output := file writing.
+	input := file reading.
+!
+
+tearDown
+
+	input close.
+	output close.
+	file delete
+! !
+
+!FileReadingWritingTest methodsFor:'tests - core'!
+
+testInsert
+	"Do nothing, since files are not expected to implement insert:* "
+! !
+
+!FileReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__PipeReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,65 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#PipeReadingWritingTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:'OS'
+	category:'Xtreams'
+!
+
+
+!PipeReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+	| pipe |
+	(OSHandle currentOS = #win32) ifTrue: [self error: 'Does not work on Windows' ].
+	pipe := OSSystemSupport concreteClass pipeAccessorClass openPair.
+	input := pipe first reading.
+	output := pipe last writing.
+!
+
+tearDown
+	input close.
+	output close.
+! !
+
+!PipeReadingWritingTest methodsFor:'utilities'!
+
+timeout: timeoutDuration server: serverBlock client: clientBlock
+	"For tests that must be able to write and read at the same time, where they may block on each.
+	 Sockets, Pipes have an operating system buffer which dictates its bandwidth."
+
+	|	timeout
+		serverSuccess serverProcess serverLock
+		clientSuccess clientProcess clientLock|
+
+	timeout := false.
+	serverLock := Semaphore new.
+	clientLock := Semaphore new.
+	serverSuccess := clientSuccess := false.
+	serverProcess := [serverSuccess := serverBlock value. serverLock signal] fork.
+	clientProcess := [clientSuccess := clientBlock value. clientLock signal] fork.
+
+	Core.Timer after: timeoutDuration do:
+		[serverProcess terminate.
+		output ifNotNil: [ output close ].
+		clientProcess terminate.
+		input ifNotNil: [ input close ].
+		timeout := true.
+		serverLock signal.
+		clientLock signal].
+	serverLock wait.
+	clientLock wait.
+
+	self assert: serverSuccess.
+	self assert: clientSuccess.
+	self deny: timeout
+! !
+
+!PipeReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__PointerReadStreamTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,75 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+TestCase subclass:#PointerReadStreamTest
+	instanceVariableNames:'pointer values'
+	classVariableNames:''
+	poolDictionaries:'External'
+	category:'Xtreams'
+!
+
+
+!PointerReadStreamTest methodsFor:'initialize-release'!
+
+prepareChars
+
+	values := 'Hello World!!'.
+	pointer := CIntegerType char malloc: values size.
+	pointer copyAt: 0 from: values size: values size startingAt: 1
+!
+
+prepareFloats
+
+	values := (1 to: 50) collect: [ :i | i reciprocal asFloat ].
+	pointer := CLimitedPrecisionRealType float malloc: values size.
+	1 to: values size do: [ :i | pointer at: i - 1 put: i reciprocal asFloat ].
+!
+
+tearDown
+
+	pointer ifNotNil: [ pointer free ]
+!
+
+testPositioningFloats
+
+	| stream |
+	self prepareFloats.
+	stream := pointer reading.
+	stream length: values size.
+	stream ++ 10.
+	self assert: stream position = 10.
+	stream -- 5.
+	self assert: stream position = 5.
+	stream += 10.
+	self assert: stream position = 10.
+	stream -= 10.
+	self assert: stream position = (values size - 10).
+	self assert: ([ stream ++ 20. false ] on: Incomplete do: [ :ex | ex count = 10 ])
+!
+
+testReadingChars
+
+	| stream |
+	self prepareFloats.
+	stream := pointer reading.
+	stream length: values size.
+	self assert: stream rest = values.
+	self should: [ stream get ] raise: Incomplete.
+!
+
+testReadingFloats
+
+	| stream |
+	self prepareFloats.
+	stream := pointer reading.
+	stream length: values size.
+	self assert: stream rest = values.
+	self should: [ stream get ] raise: Incomplete.
+! !
+
+!PointerReadStreamTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__PointerReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,31 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+InfiniteReadingWritingTests subclass:#PointerReadingWritingTest
+	instanceVariableNames:'pointer'
+	classVariableNames:''
+	poolDictionaries:'External'
+	category:'Xtreams'
+!
+
+
+!PointerReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	pointer := CIntegerType unsignedChar malloc: 1.
+	(input := pointer reading) contentsSpecies: ByteArray.
+	(output := pointer writing) contentsSpecies: ByteArray
+!
+
+tearDown
+
+	pointer free
+! !
+
+!PointerReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__PointerWriteStreamTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,66 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+TestCase subclass:#PointerWriteStreamTest
+	instanceVariableNames:'stream'
+	classVariableNames:''
+	poolDictionaries:'External'
+	category:'Xtreams'
+!
+
+
+!PointerWriteStreamTest methodsFor:'initialize-release'!
+
+prepareChars
+
+	| pointer |
+	pointer := CIntegerType char malloc: 50.
+	stream := pointer writing length: 50; yourself.
+!
+
+prepareFloats
+
+	| pointer |
+	pointer := CLimitedPrecisionRealType float malloc: 50.
+	stream := pointer writing length: 50; yourself.
+!
+
+tearDown
+
+	stream ifNotNil: [ stream terminal free. stream := nil ]
+!
+
+testWritingChars
+
+	| string result |
+	self prepareChars.
+	stream put: Character tab.
+	self assert: (stream terminal at: 0) = Character tab asInteger.
+	string := 'Hello World!!'.
+	stream write: string.
+	result := ByteString new: string size.
+	stream terminal copyAt: 1 to: result size: string size startingAt: 1. 
+	self assert: string = result.
+	stream close.
+	self assert: stream length = (string size + 1).
+!
+
+testWritingFloats
+
+	| values |
+	self prepareFloats.
+	stream put: Float pi.
+	self assert: (stream terminal at: 0) = Float pi.
+	values := (1 to: 10) collect: [ :i | i reciprocal asFloat ].
+	stream write: values.
+	self assert: (stream terminal at: 10) = 10 reciprocal asFloat.
+	stream close.
+	self assert: stream length = 11.
+! !
+
+!PointerWriteStreamTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__RingBufferReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,40 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#RingBufferReadingWritingTest
+	instanceVariableNames:'buffer'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!RingBufferReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	buffer := RingBuffer on: (ByteArray new: 8192).
+	input := buffer reading.
+	output := buffer writing.
+! !
+
+!RingBufferReadingWritingTest methodsFor:'tests - core'!
+
+testReadWriteLargeAmount
+	
+	"does not work on limited size ring buffer"
+! !
+
+!RingBufferReadingWritingTest methodsFor:'tests - transforming'!
+
+testWriteCollectingMultipleBufferSize
+
+	"does not work on limited size ring buffer"
+! !
+
+!RingBufferReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__SharedQueueReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,26 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+InfiniteReadingWritingTests subclass:#SharedQueueReadingWritingTest
+	instanceVariableNames:'queue'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Xtreams'
+!
+
+
+!SharedQueueReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	queue := SharedQueue new.
+	(input := queue reading) contentsSpecies: ByteArray.
+	(output := queue writing) contentsSpecies: ByteArray
+! !
+
+!SharedQueueReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/Xtreams__SocketReadingWritingTest.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,61 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+"{ NameSpace: Xtreams }"
+
+FiniteReadingWritingTests subclass:#SocketReadingWritingTest
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:'OS'
+	category:'Xtreams'
+!
+
+
+!SocketReadingWritingTest methodsFor:'initialize-release'!
+
+setUp
+
+	| pair |
+	"Use #phonyPair to make sure we're testing TCP sockets on Unix."
+	pair := SocketAccessor phonyPair.
+	input := pair first reading.
+	output := pair last writing.
+! !
+
+!SocketReadingWritingTest methodsFor:'utilities'!
+
+timeout: timeoutDuration server: serverBlock client: clientBlock
+	"For tests that must be able to write and read at the same time, where they may block on each.
+	 Sockets, Pipes have an operating system buffer which dictates its bandwidth."
+
+	|	timeout
+		serverSuccess serverProcess serverLock
+		clientSuccess clientProcess clientLock|
+
+	timeout := false.
+	serverLock := Semaphore new.
+	clientLock := Semaphore new.
+	serverSuccess := clientSuccess := false.
+	serverProcess := [serverSuccess := serverBlock value. serverLock signal] fork.
+	clientProcess := [clientSuccess := clientBlock value. clientLock signal] fork.
+
+	Core.Timer after: timeoutDuration do:
+		[serverProcess terminate.
+		output ifNotNil: [ output close ].
+		clientProcess terminate.
+		input ifNotNil: [ input close ].
+		timeout := true.
+		serverLock signal.
+		clientLock signal].
+	serverLock wait.
+	clientLock wait.
+
+	self assert: serverSuccess.
+	self assert: clientSuccess.
+	self deny: timeout
+! !
+
+!SocketReadingWritingTest class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/abbrev.stc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,15 @@
+Xtreams::BlockClosureReadingWritingTest Xtreams__BlockClosureReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::BlockClosureTest Xtreams__BlockClosureTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::BufferReadingWritingTest Xtreams__BufferReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::BufferedWriteStreamTest Xtreams__BufferedWriteStreamTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::CollectionReadingWritingTest Xtreams__CollectionReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::ElasticBufferReadingWritingTest Xtreams__ElasticBufferReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::FileReadingWritingTest Xtreams__FileReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::PipeReadingWritingTest Xtreams__PipeReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::PointerReadStreamTest Xtreams__PointerReadStreamTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::PointerReadingWritingTest Xtreams__PointerReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::PointerWriteStreamTest Xtreams__PointerWriteStreamTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::RingBufferReadingWritingTest Xtreams__RingBufferReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::SharedQueueReadingWritingTest Xtreams__SharedQueueReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+Xtreams::SocketReadingWritingTest Xtreams__SocketReadingWritingTest stx:goodies/xtreams/terminals/tests 'Xtreams' 1
+stx_goodies_xtreams_terminals_tests stx_goodies_xtreams_terminals_tests stx:goodies/xtreams/terminals/tests '* Projects & Packages *' 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/autopackage/default.apspec	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,85 @@
+# -*- shell-script -*-
+[Meta]
+ShortName: 
+SoftwareVersion: 6.2.1.1
+DisplayName: Smalltalk/X Class library
+RootName: @exept.de/expecco:$SOFTWAREVERSION
+Summary: Smalltalk/X Class library
+Maintainer: eXept Software AG
+Packager: eXept Software AG
+PackageVersion: 1
+CPUArchitectures: x86
+AutopackageTarget: 1.0
+Type: Library
+License: Commercial
+
+[Description]
+Smalltalk/X Class library
+
+[BuildPrepare]
+# If you're using autotools, the default should be enough.
+# prepareBuild will set up apbuild and run configure for you. If you
+# need to pass arguments to configure, just add them to prepareBuild:
+# prepareBuild --enable-foo --disable-bar
+#prepareBuild
+
+[BuildUnprepare]
+# If you're using prepareBuild above, there is no need to change this!
+#unprepareBuild
+
+[Globals]
+# Variables declared in this section will be available in all other sections
+export APKG_BUILD_SKIP_CONFIGURE=1
+export APKG_BUILD_SKIP_MAKE=1
+export MYPREFIX=/opt/
+
+[Prepare]
+#recommend '@autopackage.org/autopackage-gtk' 1
+
+[Imports]
+import <<EOF
+$source_dir/
+$source_dir/resources
+$source_dir/keyboard.rc
+$source_dir/display.rc
+$source_dir/../doc
+$source_dir/../testsuites/webedition
+$source_dir/../projects/libraries
+$source_dir/../reportGenerator/tools
+$source_dir/../../pdf/afm
+$source_dir/../plugin/selenium/libexept_expecco_plugin_selenium.so
+$source_dir/../externalTools
+EOF
+
+for i in $source_dir/*.so
+do
+    echo $source_dir/$(readlink $i)
+done | import
+
+[Install]
+if [ "$PREFIX" != "/usr" ]
+then
+    export MYPREFIX=$PREFIX
+fi
+
+find . -type d \( -name CVS -or -name 'not_*' \) -print | xargs rm -rf
+mkdir -p $MYPREFIX
+copyFiles expecco *.rc resources        $MYPREFIX/bin
+copyFiles *.so                          $MYPREFIX/lib
+copyFiles doc externalTools             $MYPREFIX/packages/exept/expecco
+copyFiles webedition/projects libraries $MYPREFIX/testsuites
+copyFiles tools                         $MYPREFIX/packages/exept/expecco/reportGenerator
+copyFiles afm                           $MYPREFIX/packages/exept/pdf
+copyFiles libexept_expecco_plugin_selenium.so   $MYPREFIX/plugin
+
+#installExe expecco
+#installLib *.so
+#installData resources
+#installData keyboard.rc
+#installData doc
+
+[Uninstall]
+# Leaving this at the default is safe unless you use custom commands in
+# "Install" to create files. All autopackage API functions
+# that installs files are logged.
+uninstallFromLog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/bc.mak	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,74 @@
+# $Header$
+#
+# DO NOT EDIT
+# automagically generated from the projectDefinition: stx_goodies_xtreams_terminals_tests.
+#
+# Warning: once you modify this file, do not rerun
+# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
+#
+# This file contains make rules for the win32 platform (using borland-bcc).
+# It shares common definitions with the unix-make in Make.spec.
+# The nt.mak supports the following targets:
+#    bmake         - compile all st-files to a classLib (dll)
+#    bmake clean   - clean all temp files
+#    bmake clobber - clean all
+#
+#
+TOP=..\..\..\..
+INCLUDE_TOP=$(TOP)\..
+
+
+
+!INCLUDE $(TOP)\rules\stdHeader_bc
+
+!INCLUDE Make.spec
+
+LIBNAME=libstx_goodies_xtreams_terminals_tests
+RESFILES=tests.res
+
+
+
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\xtreams\core\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\goodies\xtreams\core -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libbasic
+LOCALDEFINES=
+
+STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -H. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
+LOCALLIBS=
+
+OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
+
+ALL::  classLibRule
+
+classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
+
+!INCLUDE $(TOP)\rules\stdRules_bc
+
+# build all prerequisite packages for this package
+prereq:
+	pushd ..\..\..\..\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\refactoryBrowser\parser & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\core & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libboss & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libui & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libwidg2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libwidg3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libtool & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\libcompat & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd .. & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\substreams & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\core\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+	pushd ..\..\..\..\librun & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
+
+
+
+
+# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
+$(OUTDIR)stx_goodies_xtreams_terminals_tests.$(O) stx_goodies_xtreams_terminals_tests.$(H): stx_goodies_xtreams_terminals_tests.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+
+# ENDMAKEDEPEND --- do not remove this line
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/bmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using borland bcc
+@REM type bmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/lcmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using lcc compiler
+@REM type lcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak USELCC=1 %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/libInit.cc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,34 @@
+/*
+ * $Header$
+ *
+ * DO NOT EDIT
+ * automagically generated from the projectDefinition: stx_goodies_xtreams_terminals_tests.
+ */
+#define __INDIRECTVMINITCALLS__
+#include <stc.h>
+
+#ifdef WIN32
+# pragma codeseg INITCODE "INITCODE"
+#endif
+
+#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
+DLL_EXPORT void _libstx_goodies_xtreams_terminals_tests_Init() INIT_TEXT_SECTION;
+// DLL_EXPORT void _libstx_goodies_xtreams_terminals_tests_InitDefinition() INIT_TEXT_SECTION;
+#endif
+
+// void _libstx_goodies_xtreams_terminals_tests_InitDefinition(pass, __pRT__, snd)
+// OBJ snd; struct __vmData__ *__pRT__; {
+// __BEGIN_PACKAGE2__("libstx_goodies_xtreams_terminals_tests__DFN", _libstx_goodies_xtreams_terminals_tests_InitDefinition, "stx:goodies/xtreams/terminals/tests");
+// _stx_137goodies_137xtreams_137terminals_137tests_Init(pass,__pRT__,snd);
+
+// __END_PACKAGE__();
+// }
+
+void _libstx_goodies_xtreams_terminals_tests_Init(pass, __pRT__, snd)
+OBJ snd; struct __vmData__ *__pRT__; {
+__BEGIN_PACKAGE2__("libstx_goodies_xtreams_terminals_tests", _libstx_goodies_xtreams_terminals_tests_Init, "stx:goodies/xtreams/terminals/tests");
+_stx_137goodies_137xtreams_137terminals_137tests_Init(pass,__pRT__,snd);
+
+
+__END_PACKAGE__();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/stx_goodies_xtreams_terminals_tests.st	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,110 @@
+"{ Package: 'stx:goodies/xtreams/terminals/tests' }"
+
+LibraryDefinition subclass:#stx_goodies_xtreams_terminals_tests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'* Projects & Packages *'
+!
+
+
+!stx_goodies_xtreams_terminals_tests class methodsFor:'description'!
+
+excludedFromPreRequisites
+    "list all packages which should be ignored in the automatic
+     preRequisites scan. See #preRequisites for more."
+
+    ^ #(
+    )
+!
+
+preRequisites
+    "list all required packages.
+     This list can be maintained manually or (better) generated and
+     updated by scanning the superclass hierarchies and looking for
+     global variable accesses. (the browser has a menu function for that)
+     Howevery, often too much is found, and you may want to explicitely
+     exclude individual packages in the #excludedFromPrerequisites method."
+
+    ^ #(
+        #'stx:libbasic'    "ProjectDefinition - superclass of stx_goodies_xtreams_terminals_tests "
+    )
+! !
+
+!stx_goodies_xtreams_terminals_tests class methodsFor:'description - contents'!
+
+classNamesAndAttributes
+    "lists the classes which are to be included in the project.
+     Each entry in the list may be: a single class-name (symbol),
+     or an array-literal consisting of class name and attributes.
+     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
+
+    ^ #(
+        "<className> or (<className> attributes...) in load order"
+        #'stx_goodies_xtreams_terminals_tests'
+    )
+!
+
+extensionMethodNames
+    "lists the extension methods which are to be included in the project.
+     Entries are 2-element array literals, consisting of class-name and selector."
+
+    ^ #(
+    )
+! !
+
+!stx_goodies_xtreams_terminals_tests class methodsFor:'description - project information'!
+
+applicationIconFileName
+    "Return the name (without suffix) of an icon-file (the app's icon); will be included in the rc-resource file"
+
+    ^ nil
+    "/ ^ self applicationName
+!
+
+companyName
+    "Return a companyname which will appear in <lib>.rc"
+
+    ^ 'eXept Software AG'
+!
+
+description
+    "Return a description string which will appear in vc.def / bc.def"
+
+    ^ 'Smalltalk/X Class library'
+!
+
+legalCopyright
+    "Return a copyright string which will appear in <lib>.rc"
+
+    ^ 'Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011'
+!
+
+productName
+    "Return a product name which will appear in <lib>.rc"
+
+    ^ 'Smalltalk/X'
+! !
+
+!stx_goodies_xtreams_terminals_tests class methodsFor:'description - svn'!
+
+svnRepositoryUrlString
+    "Return a SVN repository URL of myself.
+     (Generated since 2011-04-08)
+    "        
+
+    ^ '$URL$'
+!
+
+svnRevisionNr
+    "Return a SVN revision number of myself.
+     This number is updated after a commit"
+
+    ^ "$SVN-Revision:"'nil'"$"
+! !
+
+!stx_goodies_xtreams_terminals_tests class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id$'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/tests.rc	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,35 @@
+//
+// DO NOT EDIT
+// automagically generated from the projectDefinition: stx_goodies_xtreams_terminals_tests.
+//
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION     6,2,0,1
+  PRODUCTVERSION  6,2,1,1
+  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
+  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
+  FILEOS          VOS_NT_WINDOWS32
+  FILETYPE        VFT_DLL
+  FILESUBTYPE     VS_USER_DEFINED
+
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "040904E4"
+    BEGIN
+      VALUE "CompanyName", "eXept Software AG\0"
+      VALUE "FileDescription", "Smalltalk/X Class library (LIB)\0"
+      VALUE "FileVersion", "6.2.0.1\0"
+      VALUE "InternalName", "stx:goodies/xtreams/terminals/tests\0"
+      VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
+      VALUE "ProductName", "Smalltalk/X\0"
+      VALUE "ProductVersion", "6.2.1.1\0"
+      VALUE "ProductDate", "Mon, 22 Aug 2011 16:03:17 GMT\0"
+    END
+
+  END
+
+  BLOCK "VarFileInfo"
+  BEGIN                               //  Language   |    Translation
+    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
+  END
+END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/tests/vcmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using microsoft visual c
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak -DUSEVC %1 %2
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminals/vcmake.bat	Mon Aug 22 16:04:00 2011 +0000
@@ -0,0 +1,8 @@
+@REM -------
+@REM make using microsoft visual c
+@REM type vcmake, and wait...
+@REM do not edit - automatically generated from ProjectDefinition
+@REM -------
+make.exe -N -f bc.mak -DUSEVC %1 %2
+
+