Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/Makefile.in	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -231,7 +231,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcfa/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/libcfa/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu src/libcfa/Makefile
+	  $(AUTOMAKE) --foreign src/libcfa/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Index: src/libcfa/builtins.cf
===================================================================
--- src/libcfa/builtins.cf	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/builtins.cf	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -390,11 +390,11 @@
 int __builtin_sprintf(char *, const char *, ...);
 int __builtin_sscanf(const char *, const char *, ...);
-int __builtin_vfprintf(struct _IO_FILE *, const char *, void **);
-int __builtin_vfscanf(struct _IO_FILE *, const char *, void **);
-int __builtin_vprintf(const char *, void **);
-int __builtin_vscanf(const char *, void **);
-int __builtin_vsnprintf(char *, unsigned long, const char *, void **);
-int __builtin_vsprintf(char *, const char *, void **);
-int __builtin_vsscanf(const char *, const char *, void **);
+int __builtin_vfprintf(struct _IO_FILE *, const char *, __builtin_va_list);
+int __builtin_vfscanf(struct _IO_FILE *, const char *, __builtin_va_list);
+int __builtin_vprintf(const char *, __builtin_va_list);
+int __builtin_vscanf(const char *, __builtin_va_list);
+int __builtin_vsnprintf(char *, unsigned long, const char *, __builtin_va_list);
+int __builtin_vsprintf(char *, const char *, __builtin_va_list);
+int __builtin_vsscanf(const char *, const char *, __builtin_va_list);
 int __builtin_isalnum(int);
 int __builtin_isalpha(int);
@@ -534,7 +534,7 @@
 void __builtin_unwind_init();
 void __builtin_update_setjmp_buf(void *, int);
-void __builtin_va_copy(void **, void **);
-void __builtin_va_end(void **);
-void __builtin_va_start(void **, ...);
+void __builtin_va_copy(__builtin_va_list, __builtin_va_list);
+void __builtin_va_end(__builtin_va_list);
+void __builtin_va_start(__builtin_va_list, ...);
 int __builtin_va_arg_pack();
 int __builtin_va_arg_pack_len();
@@ -563,10 +563,10 @@
 int __builtin___snprintf_chk(char *, unsigned long, int, unsigned long, const char *, ...);
 int __builtin___sprintf_chk(char *, int, unsigned long, const char *, ...);
-int __builtin___vsnprintf_chk(char *, unsigned long, int, unsigned long, const char *, void **);
-int __builtin___vsprintf_chk(char *, int, unsigned long, const char *, void **);
+int __builtin___vsnprintf_chk(char *, unsigned long, int, unsigned long, const char *, __builtin_va_list);
+int __builtin___vsprintf_chk(char *, int, unsigned long, const char *, __builtin_va_list);
 int __builtin___fprintf_chk(struct _IO_FILE *, int, const char *, ...);
 int __builtin___printf_chk(int, const char *, ...);
-int __builtin___vfprintf_chk(struct _IO_FILE *, int, const char *, void **);
-int __builtin___vprintf_chk(int, const char *, void **);
+int __builtin___vfprintf_chk(struct _IO_FILE *, int, const char *, __builtin_va_list);
+int __builtin___vprintf_chk(int, const char *, __builtin_va_list);
 void __cyg_profile_func_enter(void *, void *);
 void __cyg_profile_func_exit(void *, void *);
@@ -583,5 +583,4 @@
 const char * __builtin_FUNCTION();
 int __builtin_LINE();
-typedef void ** __builtin_va_list;
 extern const char *__PRETTY_FUNCTION__;
 typedef int wchar_t;
Index: src/libcfa/fstream
===================================================================
--- src/libcfa/fstream	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/fstream	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -7,9 +7,9 @@
 // fstream -- 
 //
-// Author           : Richard C. Bilson
+// Author           : Peter A. Buhr
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 17 14:02:01 2016
-// Update Count     : 22
+// Last Modified On : Wed Mar  2 15:08:14 2016
+// Update Count     : 78
 //
 
@@ -19,25 +19,33 @@
 #include "iostream"
 
-// implement context ostream
-struct ofstream;
+enum { separateSize = 16 };
+struct ofstream { void *file; int separate; char separator[separateSize]; };
 
-int fail( ofstream * os );
-int flush( ofstream * os );
-void open( ofstream ** os, const char * name, const char * mode );
-void close( ofstream * os );
-ofstream * write( ofstream * os, const char * data, streamsize_type size );
+_Bool sepPrt( ofstream * );
+void sepOn( ofstream * );
+void sepOff( ofstream * );
+void sepSet( ofstream *, const char * );
+const char * sepGet( ofstream * );
+void sepDisable( ofstream * );
+void sepEnable( ofstream * );
+int fail( ofstream * );
+int flush( ofstream * );
+void open( ofstream *, const char * name, const char * mode );
+void close( ofstream * );
+ofstream * write( ofstream *, const char * data, unsigned long int size );
+int prtfmt( ofstream *, const char fmt[], ... );
 
 extern ofstream * sout, * serr;
 
 // implement context istream
-struct ifstream;
+struct ifstream { void *file; };
 
 int fail( ifstream * is );
 int eof( ifstream * is );
-void open( ifstream ** is, const char * name, const char * mode );
+void open( ifstream * is, const char * name, const char * mode );
 void close( ifstream * is );
-ifstream * get( ifstream * is, int * data );
-ifstream * read( ifstream * is, char * data, streamsize_type size );
+ifstream * read( ifstream * is, char * data, unsigned long int size );
 ifstream * ungetc( ifstream * is, char c );
+int scanfmt( ifstream *, const char fmt[], ... );
 
 extern ifstream *sin;
@@ -49,2 +57,3 @@
 // tab-width: 4 //
 // End: //
+
Index: src/libcfa/fstream.c
===================================================================
--- src/libcfa/fstream.c	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/fstream.c	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -7,9 +7,9 @@
 // fstream.c -- 
 //
-// Author           : Richard C. Bilson
+// Author           : Peter A. Buhr
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 17 14:03:05 2016
-// Update Count     : 76
+// Last Modified On : Mon Feb 29 18:41:10 2016
+// Update Count     : 162
 //
 
@@ -17,40 +17,53 @@
 
 extern "C" {
-#include <stdio.h>
-#include <stdlib.h>
+#include <stdio.h>										// vfprintf, vfscanf
+#include <stdlib.h>										// exit
+#include <stdarg.h>										// varargs
+#include <string.h>										// strlen
+#include <float.h>										// DBL_DIG, LDBL_DIG
+#include <complex.h>									// creal, cimag
 }
-
-struct ofstream {
-	FILE *file;
-};
 
 #define IO_MSG "I/O error "
 
+_Bool sepPrt( ofstream * os ) { return os->separate == 1; }
+void sepOn( ofstream * os ) { if ( os->separate != 2 ) os->separate = 1; }
+void sepOff( ofstream * os ) { if ( os->separate != 2 ) os->separate = 0; }
+void sepSet( ofstream * os, const char * s ) {
+	strncpy( &(os->separator[0]), s, separateSize - 1 );
+	os->separator[separateSize - 1] = '\0';
+} // sepSet
+const char * sepGet( ofstream * os ) { return &(os->separator[0]); }
+void sepDisable( ofstream *os ) { os->separate = 2; }
+void sepEnable( ofstream *os ) { os->separate = 0; }
+
 int fail( ofstream * os ) {
-	return ferror( os->file );
+	return ferror( (FILE *)(os->file) );
 } // fail
 
 int flush( ofstream * os ) {
-	return fflush( os->file );
+	return fflush( (FILE *)(os->file) );
 } // flush
 
-void open( ofstream ** os, const char * name, const char * mode ) {
-	FILE *t = fopen( name, mode );
-	if ( t == 0 ) {										// do not change unless successful
+void open( ofstream * os, const char * name, const char * mode ) {
+	FILE *file = fopen( name, mode );
+	if ( file == 0 ) {									// do not change unless successful
 		perror( IO_MSG "open output" );
 		exit( EXIT_FAILURE );
 	} // if
-	(*os)->file = t;
+	os->file = file;
+	sepOff( os );
+	sepSet( os, " " );
 } // open
 
 void close( ofstream * os ) {
-	if ( os->file == stdout || os->file == stderr ) return;
+	if ( (FILE *)(os->file) == stdout || (FILE *)(os->file) == stderr ) return;
 
-	if ( fclose( os->file ) == EOF ) {
+	if ( fclose( (FILE *)(os->file) ) == EOF ) {
 		perror( IO_MSG "close output" );
 	} // if 
 } // close
 
-ofstream * write( ofstream * os, const char * data, streamsize_type size ) {
+ofstream * write( ofstream * os, const char * data, unsigned long int size ) {
 	if ( fail( os ) ) {
 		fprintf( stderr, "attempt write I/O on failed stream\n" );
@@ -58,5 +71,5 @@
 	} // if
 
-	if ( fwrite( data, 1, size, os->file ) != size ) {
+	if ( fwrite( data, 1, size, (FILE *)(os->file) ) != size ) {
 		perror( IO_MSG "write" );
 		exit( EXIT_FAILURE );
@@ -65,34 +78,55 @@
 } // write
 
-static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_) };
+int prtfmt( ofstream * os, const char fmt[], ... ) {
+    va_list args;
+
+    va_start( args, fmt );
+    int len = vfprintf( (FILE *)(os->file), fmt, args );
+	if ( len == EOF ) {
+		if ( ferror( (FILE *)(os->file) ) ) {
+			fprintf( stderr, "invalid write\n" );
+			exit( EXIT_FAILURE );
+		} // if
+	} // if
+    va_end( args );
+	return len;
+} // prtfmt
+
+
+static ofstream soutFile = { (FILE *)(&_IO_2_1_stdout_), 0, { ' ', '\0' } };
 ofstream *sout = &soutFile;
-static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_) };
+static ofstream serrFile = { (FILE *)(&_IO_2_1_stderr_), 0, { ' ', '\0' } };
 ofstream *serr = &serrFile;
+
 
 //---------------------------------------
 
-struct ifstream {
-	FILE *file;
-};
 
 int fail( ifstream * is ) {
-	return ferror( is->file );
+	return ferror( (FILE *)(is->file) );
 } // fail
 
 int eof( ifstream * is ) {
-	return feof( is->file );
+	return feof( (FILE *)(is->file) );
 } // eof
 
-ifstream * get( ifstream * is, int * data ) {
-	if ( fscanf( is->file, "%d", data ) == EOF ) {
-		if ( ferror( is->file ) ) {
-			fprintf( stderr, "invalid int read\n" );
-			exit( EXIT_FAILURE );
-		} // if
+void open( ifstream * is, const char * name, const char * mode ) {
+	FILE *t = fopen( name, mode );
+	if ( t == 0 ) {										// do not change unless successful
+		perror( IO_MSG "open input" );
+		exit( EXIT_FAILURE );
 	} // if
-	return is;
-} // read
+	is->file = t;
+} // open
 
-ifstream * read( ifstream * is, char * data, streamsize_type size ) {
+void close( ifstream * is ) {
+	if ( (FILE *)(is->file) == stdin ) return;
+
+	if ( fclose( (FILE *)(is->file) ) == EOF ) {
+		perror( IO_MSG "close input" );
+	} // if 
+} // close
+
+ifstream * read( ifstream * is, char * data, unsigned long int size ) {
 	if ( fail( is ) ) {
 		fprintf( stderr, "attempt read I/O on failed stream\n" );
@@ -100,5 +134,5 @@
 	} // if
 
-	if ( fread( data, size, 1, is->file ) == 0 ) {
+	if ( fread( data, size, 1, (FILE *)(is->file) ) == 0 ) {
 		perror( IO_MSG "read" );
 		exit( EXIT_FAILURE );
@@ -113,5 +147,5 @@
 	} // if
 
-	if ( ungetc( c, is->file ) == EOF ) {
+	if ( ungetc( c, (FILE *)(is->file) ) == EOF ) {
 		perror( IO_MSG "ungetc" );
 		exit( EXIT_FAILURE );
@@ -120,20 +154,19 @@
 } // ungetc
 
-void open( ifstream ** is, const char * name, const char * mode ) {
-	FILE *t = fopen( name, mode );
-	if ( t == 0 ) {										// do not change unless successful
-		perror( IO_MSG "open input" );
-		exit( EXIT_FAILURE );
+int scanfmt( ifstream * is, const char fmt[], ... ) {
+    va_list args;
+
+    va_start( args, fmt );
+    int len = vfscanf( (FILE *)(is->file), fmt, args );
+	if ( len == EOF ) {
+		if ( ferror( (FILE *)(is->file) ) ) {
+			fprintf( stderr, "invalid read\n" );
+			exit( EXIT_FAILURE );
+		} // if
 	} // if
-	(*is)->file = t;
-} // open
+    va_end( args );
+	return len;
+} // prtfmt
 
-void close( ifstream * is ) {
-	if ( is->file == stdin ) return;
-
-	if ( fclose( is->file ) == EOF ) {
-		perror( IO_MSG "close input" );
-	} // if 
-} // close
 
 static ifstream sinFile = { (FILE *)(&_IO_2_1_stdin_) };
Index: src/libcfa/iostream
===================================================================
--- src/libcfa/iostream	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/iostream	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -7,23 +7,32 @@
 // iostream -- 
 //
-// Author           : Richard C. Bilson
+// Author           : Peter A. Buhr
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 17 14:04:24 2016
-// Update Count     : 32
+// Last Modified On : Wed Mar  2 16:44:32 2016
+// Update Count     : 81
 //
 
-#ifndef IOSTREAM_H
-#define IOSTREAM_H
+#ifndef __IOSTREAM_H__
+#define __IOSTREAM_H__
 
 #include "iterator"
 
-typedef unsigned long streamsize_type;
-
 context ostream( dtype ostype ) {
+	_Bool sepPrt( ostype * );
+	void sepOn( ostype * );
+	void sepOff( ostype * );
+	void sepSet( ostype *, const char * );
+	const char * sepGet( ostype * );
+	void sepDisable( ostype * );
+	void sepEnable( ostype * );
 	int fail( ostype * );
 	int flush( ostype * );
-	ostype * write( ostype *, const char *, streamsize_type );
+	void open( ostype * os, const char * name, const char * mode );
+	void close( ostype * os );
+	ostype * write( ostype *, const char *, unsigned long int );
+	int prtfmt( ostype *, const char fmt[], ... );
 };
+
 context writeable( type T ) {
 	forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T );
@@ -33,4 +42,7 @@
 
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
+
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, short int );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned short int );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int );
@@ -39,15 +51,20 @@
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long int );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned long long int );
+
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float ); // FIX ME: should not be required
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double );
+
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, float _Complex );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, double _Complex );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long double _Complex );
+
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const char * );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, const void * );
 
-forall( dtype ostype, dtype retostype | ostream( ostype ) | ostream( retostype ) ) retostype * ?|?( ostype *os, retostype * (* manip)(ostype*) );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, ostype * (*)( ostype * ) );
 forall( dtype ostype | ostream( ostype ) ) ostype * endl( ostype * );
+forall( dtype ostype | ostream( ostype ) ) ostype * sepOn( ostype * );
+forall( dtype ostype | ostream( ostype ) ) ostype * sepOff( ostype * );
 
 // writes the range [begin, end) to the given stream
@@ -63,7 +80,9 @@
 	int fail( istype * );
 	int eof( istype * );
-	istype * get( istype *, int * );
-	istype * read( istype *, char *, streamsize_type );
+	void open( istype * is, const char * name, const char * mode );
+	void close( istype * is );
+	istype * read( istype *, char *, unsigned long int );
 	istype * ungetc( istype *, char );
+	int scanfmt( istype *, const char fmt[], ... );
 };
 
@@ -72,11 +91,32 @@
 };
 
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *, char * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, char * );
 
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *, int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, short int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned short int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long long int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long int * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, unsigned long long int * );
 
-#endif // IOSTREAM_H
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double * );
+
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, float _Complex * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, double _Complex * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, long double _Complex * );
+
+struct _Istream_str1 { char * s; };
+_Istream_str1 str( char * );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_str1 );
+
+struct _Istream_str2 { char * s; int size; };
+_Istream_str2 str( char *, int size );
+forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, _Istream_str2 );
+
+#endif // __IOSTREAM_H__
 
 // Local Variables: //
Index: src/libcfa/iostream.c
===================================================================
--- src/libcfa/iostream.c	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/iostream.c	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -7,9 +7,9 @@
 // iostream.c -- 
 //
-// Author           : Richard C. Bilson
+// Author           : Peter A. Buhr
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 17 14:19:56 2016
-// Update Count     : 76
+// Last Modified On : Wed Mar  2 16:20:57 2016
+// Update Count     : 207
 //
 
@@ -21,117 +21,177 @@
 #include <float.h>										// DBL_DIG, LDBL_DIG
 #include <complex.h>									// creal, cimag
+#include <ctype.h>										// isspace, ispunct
 }
 
 forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype *os, char c ) {
-	return write( os, &c, 1 );
+	prtfmt( os, "%c", c );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, short int si ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%hd", si );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, unsigned short int usi ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%hu", usi );
+	return os;
 } // ?|?
 
 forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype *os, int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%d", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%u", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%ld", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%lld", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%lu", i ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, unsigned long long int i ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%llu", i ) );
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%d", i );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, unsigned int ui ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%u", ui );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long int li ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%ld", li );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, unsigned long int uli ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%lu", uli );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long long int lli ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%lld", lli );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, unsigned long long int ulli ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%llu", ulli );
+	return os;
 } // ?|?
 
 forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype *os, float f ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%g", f ) );
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%g", f );
+	return os;
 } // ?|?
 
 forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype *os, double d ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%.*lg", DBL_DIG, d ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long double d ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%.*Lg", LDBL_DIG, d ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, float _Complex c ) {
-	return os | crealf( c ) | (cimagf( c ) < 0 ? "" : "+") | cimagf( c ) | 'i';
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, double _Complex c ) {
-	return os | creal( c ) | (cimag( c ) < 0 ? "" : "+") | cimag( c ) | 'i';
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, long double _Complex c ) {
-	return os | creall( c ) | (cimagl( c ) < 0 ? "" : "+") | cimagl( c ) | 'i';
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%.*lg", DBL_DIG, d );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long double ld ) {
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%.*Lg", LDBL_DIG, ld );
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, float _Complex fc ) {
+	os | crealf( fc );
+	if ( cimagf( fc ) >= 0 ) os | '+';
+	os | "" | cimagf( fc ) | 'i';
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, double _Complex dc ) {
+	os | creal( dc );
+	if ( cimag( dc ) >= 0 ) os | '+';
+	os | "" | cimag( dc ) | 'i';
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long double _Complex ldc ) {
+	os | creall( ldc );
+	if ( cimagl( ldc ) >= 0 ) os | '+';
+	os | "" | cimagl( ldc ) | 'i';
+	return os;
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, const char *cp ) {
+	int len = strlen( cp );
+	// null string => no separator
+  if ( len == 0 ) { sepOff( os ); return os; }
+	// first character NOT spacing or special punctuation => add left separator
+	if ( sepPrt( os ) && isspace( cp[0] ) == 0 && cp[0] != '.' && cp[0] != ',' ) {
+		prtfmt( os, "%s", sepGet( os ) );
+	} // if
+	// last character is spacing or special punctuation => turn off separator for next item
+	unsigned int posn = len - 1;
+	if ( isspace( cp[posn] ) || cp[posn] == ':' || cp[posn] == '$' ) {
+		sepOff( os );
+	} else {
+		sepOn( os );
+	} // if
+	return write( os, cp, len );
 } // ?|?
 
 forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype *os, const void *p ) {
-	char buffer[32];
-	return write( os, buffer, sprintf( buffer, "%p", p ) );
-} // ?|?
-
-forall( dtype ostype | ostream( ostype ) )
-ostype * ?|?( ostype *os, const char *cp ) {
-	return write( os, cp, strlen( cp ) );
-} // ?|?
-
-
-forall( dtype ostype, dtype retostype | ostream( ostype ) | ostream( retostype ) ) 
-retostype * ?|?( ostype *os, retostype * (*manip)(ostype*) ) {
-  return manip( os );
-}
+	if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) ); else sepOn( os );
+	prtfmt( os, "%p", p );
+	return os;
+} // ?|?
+
+
+forall( dtype ostype | ostream( ostype ) ) 
+ostype * ?|?( ostype *os, ostype * (* manip)( ostype * ) ) {
+	return manip( os );
+} // ?|?
 
 forall( dtype ostype | ostream( ostype ) ) 
 ostype * endl( ostype * os ) {
-	os | "\n";
+	os | '\n';
 	flush( os );
+	sepOff( os );
 	return os;
 } // endl
 
+forall( dtype ostype | ostream( ostype ) ) 
+ostype * sepOn( ostype * os ) {
+	sepOn( os );
+	return os;
+} // sepOn
+
+forall( dtype ostype | ostream( ostype ) ) 
+ostype * sepOff( ostype * os ) {
+	sepOff( os );
+	return os;
+} // sepOff
+
 //---------------------------------------
 
-forall( type elt_type | writeable( elt_type ), type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write( iterator_type begin, iterator_type end, os_type *os ) {
-	void print( elt_type i ) { os | i | ' '; }
+forall( type elttype | writeable( elttype ), type iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
+void write( iteratortype begin, iteratortype end, ostype *os ) {
+	void print( elttype i ) { os | i; }
 	for_each( begin, end, print );
 } // ?|?
 
-forall( type elt_type | writeable( elt_type ), type iterator_type | iterator( iterator_type, elt_type ),
-		dtype os_type | ostream( os_type ) )
-void write_reverse( iterator_type begin, iterator_type end, os_type *os ) {
-	void print( elt_type i ) { os | i | ' '; }
+forall( type elttype | writeable( elttype ), type iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
+void write_reverse( iteratortype begin, iteratortype end, ostype *os ) {
+	void print( elttype i ) { os | i; }
 	for_each_reverse( begin, end, print );
 } // ?|?
@@ -140,12 +200,116 @@
 
 forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *is, char *cp ) {
-	return read( is, cp, 1 );
-} // ?|?
-
-forall( dtype istype | istream( istype ) )
-istype * ?|?( istype *is, int *ip ) {
-	return get( is, ip );
-} // ?|?
+istype * ?|?( istype * is, char * c ) {
+	scanfmt( is, "%c", c );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, short int * si ) {
+	scanfmt( is, "%hd", si );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, unsigned short int * usi ) {
+	scanfmt( is, "%hu", usi );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, int * i ) {
+	scanfmt( is, "%d", i );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, unsigned int * ui ) {
+	scanfmt( is, "%u", ui );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, long int * li ) {
+	scanfmt( is, "%ld", li );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, unsigned long int * ulli ) {
+	scanfmt( is, "%lu", ulli );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, long long int * lli ) {
+	scanfmt( is, "%lld", lli );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, unsigned long long int * ulli ) {
+	scanfmt( is, "%llu", ulli );
+	return is;
+} // ?|?
+
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, float * f ) {
+	scanfmt( is, "%f", f );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, double * d ) {
+	scanfmt( is, "%lf", d );
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, long double * ld ) {
+	scanfmt( is, "%Lf", ld );
+	return is;
+} // ?|?
+
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, float _Complex * fc ) {
+	float re, im;
+	scanfmt( is, "%g%gi", &re, &im );
+	*fc = re + im * _Complex_I;
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, double _Complex * dc ) {
+	double re, im;
+	scanfmt( is, "%lf%lfi", &re, &im );
+	*dc = re + im * _Complex_I;
+	return is;
+} // ?|?
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, long double _Complex * ldc ) {
+	long double re, im;
+	scanfmt( is, "%Lf%Lfi", &re, &im );
+	*ldc = re + im * _Complex_I;
+	return is;
+} // ?|?
+
+_Istream_str1 str( char * s ) { _Istream_str1 s = { s }; return s; }
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, _Istream_str1 str ) {
+	scanfmt( is, "%s", str.s );
+	return is;
+} // str
+
+_Istream_str2 str( char * s, int size ) { _Istream_str2 s = { s, size }; return s; }
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype * is, _Istream_str2 str ) {
+	char buf[16];
+	sprintf( buf, "%%%ds", str.size );
+	scanfmt( is, buf, str.s );
+	return is;
+} // str
 
 // Local Variables: //
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/stdlib	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Feb  5 15:21:18 2016
-// Update Count     : 61
+// Last Modified On : Wed Mar  2 16:52:25 2016
+// Update Count     : 63
 //
 
@@ -25,5 +25,4 @@
 forall( type T ) T * malloc( void );
 forall( type T ) T * malloc( char fill );
-forall( type T ) T * malloc( size_t size );
 forall( type T ) T * malloc( T * ptr, size_t size );
 forall( type T ) T * malloc( T * ptr, size_t size, unsigned char fill );
Index: src/libcfa/stdlib.c
===================================================================
--- src/libcfa/stdlib.c	(revision 6ba0659196615bb32989214ed6976c448620b387)
+++ src/libcfa/stdlib.c	(revision 8f610e85034e657895664d61abfdf69e19a46724)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 10 15:45:56 2016
-// Update Count     : 140
+// Last Modified On : Tue Feb 23 21:02:54 2016
+// Update Count     : 142
 //
 
@@ -123,4 +123,5 @@
 	return ulli;
 }
+
 float ato( const char * ptr ) {
 	float f;
@@ -138,4 +139,5 @@
 	return ld;
 }
+
 float _Complex ato( const char * ptr ) {
 	float re, im;
@@ -172,4 +174,5 @@
 	return strtoull( sptr, eptr, base );
 }
+
 float strto( const char * sptr, char ** eptr ) {
 	return strtof( sptr, eptr );
@@ -181,4 +184,5 @@
 	return strtold( sptr, eptr );
 }
+
 float _Complex strto( const char * sptr, char ** eptr ) {
 	float re, im;
