Index: doc/user/Cdecl.fig
===================================================================
--- doc/user/Cdecl.fig	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
+++ doc/user/Cdecl.fig	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -0,0 +1,69 @@
+#FIG 3.2  Produced by xfig version 3.2.5b
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+6 1125 1200 2025 1650
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 1275 1200 2025 1200 2025 1350 1275 1350 1275 1200
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 1425 1200 1425 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 1575 1200 1575 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 1725 1200 1725 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 1875 1200 1875 1350
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 1350 1275 1350 1500
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 1500 1275 1500 1500
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 1650 1275 1650 1500
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 1800 1275 1800 1500
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 1950 1275 1950 1500
+4 1 0 50 -1 4 9 0.0000 2 105 90 1350 1650 0\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 1500 1650 1\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 1650 1650 2\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 1800 1650 3\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 1950 1650 4\001
+4 1 0 50 -1 4 9 0.0000 2 75 75 1200 1325 x\001
+-6
+6 2325 1200 3600 1350
+6 2475 1200 3600 1350
+6 2850 1200 3600 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3000 1200 3000 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3150 1200 3150 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3300 1200 3300 1350
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 3450 1200 3450 1350
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 2850 1200 3600 1200 3600 1350 2850 1350 2850 1200
+4 1 0 50 -1 4 9 0.0000 2 105 90 2925 1325 0\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 3075 1325 1\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 3225 1325 2\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 3375 1325 3\001
+4 1 0 50 -1 4 9 0.0000 2 105 90 3525 1325 4\001
+-6
+2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 2475 1200 2625 1200 2625 1350 2475 1350 2475 1200
+2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2
+	1 1 1.00 45.00 90.00
+	 2550 1275 2850 1275
+-6
+4 1 0 50 -1 4 9 0.0000 2 75 75 2400 1325 x\001
+-6
Index: doc/user/Makefile
===================================================================
--- doc/user/Makefile	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ doc/user/Makefile	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -12,4 +12,5 @@
 
 FIGURES = ${addsuffix .tex, \
+Cdecl \
 }
 
Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ doc/user/user.tex	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Sun Apr 10 22:50:15 2016
-%% Update Count     : 72
+%% Last Modified On : Thu Apr 21 08:15:37 2016
+%% Update Count     : 131
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -26,4 +26,5 @@
 \usepackage{upquote}
 \usepackage{fullpage,times}
+\usepackage{epic,eepic}
 \usepackage{xspace}
 \usepackage{varioref}
@@ -48,4 +49,5 @@
 % Names used in the document.
 
+\newcommand{\Version}{1.0.0}
 \newcommand{\CS}{C\raisebox{-0.9ex}{\large$^\sharp$}\xspace}
 
@@ -105,5 +107,5 @@
 The syntax of the \CFA language builds from C, and should look immediately familiar to C programmers.
 % Any language feature that is not described here can be assumed to be using the standard C11 syntax.
-\CFA adds many modern programming-language features, which directly leads to increased safety and productivity, while maintaining interoperability with existing C programs and maintaining C-like performance.
+\CFA adds many modern programming-language features, which directly leads to increased safety and productivity, while maintaining interoperability with existing C programs and achieving C performance.
 Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global garbage-collection.
 The primary new features include parametric-polymorphism routines and types, exceptions, concurrency, and modules.
@@ -224,5 +226,5 @@
 
 
-\section{Compiling \CFA}
+\section{Compiling \CFA Program}
 
 The command \lstinline@cfa@ is used to compile \CFA program(s).
@@ -231,9 +233,15 @@
 cfa [ gcc-options ] C/@{\CFA}@-files [ assembler/loader-files ]
 \end{lstlisting}
+\index{cfa@\lstinline$cfa$}\index{compilation!cfa@\lstinline$cfa$}
 By default, \CFA programs having the following \lstinline@gcc@ flags turned on:
 \begin{description}
 \item
 \hspace*{-4pt}\lstinline@-std=gnu99@
+\index{-std=gnu99@{\lstinline$-std=gnu99$}}\index{compilation option!-std=gnu99@{\lstinline$-std=gnu99$}}
 The 1999 C standard plus GNU extensions.
+\item
+\hspace*{-4pt}\lstinline@-fgnu89-inline@
+\index{-fgnu89-inline@{\lstinline$-fgnu89-inline$}}\index{compilation option!-fgnu89-inline@{\lstinline$-fgnu89-inline$}}
+Use the traditional GNU semantics for inline routines in C99 mode.
 \end{description}
 The following new \CFA option is available:
@@ -241,6 +249,43 @@
 \item
 \hspace*{-4pt}\lstinline@-CFA@
+\index{-CFA@{\lstinline$-CFA$}}\index{compilation option!-CFA@{\lstinline$-CFA$}}
 Only the C preprocessor and the \CFA translator steps are performed and the transformed program is written to standard output, which makes it possible to examine the code generated by the \CFA translator.
 \end{description}
+
+The following preprocessor variables are available:
+\begin{description}
+\item
+\hspace*{-4pt}\lstinline$__CFA__$
+\index{__CFA__@{\lstinline$__CFA__$}}\index{preprocessor variables!__CFA__@{\lstinline$__CFA__$}}
+is always available during preprocessing and its value is the current major \Index{version number} of \CFA.\footnote{
+The C preprocessor allows only integer values in a preprocessor variable so a value like ``\Version'' is not allowed.
+Hence, the need to have three variables for the major, minor and patch version number.}
+
+\item
+\hspace*{-4pt}\lstinline$__CFA_MINOR__$
+\index{__CFA_MINOR__@{\lstinline$__CFA_MINOR__$}}\index{preprocessor variables!__CFA_MINOR__@{\lstinline$__CFA_MINOR__$}}
+is always available during preprocessing and its value is the current minor \Index{version number} of \CFA.
+
+\item
+\hspace*{-4pt}\lstinline$__CFA_PATCH__$
+\index{__CFA_PATCH__@%(__CFA_PATCH__%)}\index{preprocessor variables!__CFA_PATCH__@%(__CFA_PATCH__%)}
+is always available during preprocessing and its value is the current patch \Index{version number} of \CFA.
+
+\item
+\hspace*{-4pt}\lstinline$__CFORALL__$
+\index{__CFORALL__@%(__CFORALL__%)}\index{preprocessor variables!__CFORALL__@%(__CFORALL__%)}
+is always available during preprocessing and it has no value.
+\end{description}
+
+These preprocessor variables allow conditional compilation of programs that must work differently in these situations.
+For example, to toggle between C and \CFA extensions, using the following:
+\begin{lstlisting}
+#ifndef __CFORALL__
+#include <stdio.h>		// C header file
+#else
+#include <fstream>		// @\CFA{}@ header file
+#endif
+\end{lstlisting}
+which conditionally includes the correct header file, if the program is compiled using \lstinline@gcc@ or \lstinline@cfa@. 
 
 
@@ -284,13 +329,19 @@
 C declaration syntax is notoriously confusing and error prone.
 For example, many C programmers are confused by a declaration as simple as:
-\begin{lstlisting}
-int *x[ 10 ]
-\end{lstlisting}
-Is this a pointer to an array of 10 integers or an array of 10 pointers to integers?
+\begin{quote2}
+\begin{tabular}{@{}ll@{}}
+\begin{lstlisting}[aboveskip=0pt,belowskip=0pt]
+int *x[ 5 ]
+\end{lstlisting}
+&
+\raisebox{-0.75\totalheight}{\input{Cdecl}}
+\end{tabular}
+\end{quote2}
+Is this an array of 5 pointers to integers or a pointer to an array of 5 integers?
 Another example of confusion results from the fact that a routine name and its parameters are embedded within the return type, mimicking the way the return value is used at the routine's call site.
 For example, a routine returning a pointer to an array of integers is defined and used in the following way:
 \begin{lstlisting}
-int (*f())[ 10 ] {...};
-... (*f())[  3 ] += 1;	// definition mimics usage
+int (*f())[ 5 ] {...};	// definition mimics usage
+... (*f())[ 3 ] += 1;
 \end{lstlisting}
 Essentially, the return type is wrapped around the routine name in successive layers (like an onion).
@@ -322,29 +373,29 @@
 \multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}	& \multicolumn{1}{c@{\hspace{20pt}}}{\textbf{C}}	\\
 \begin{lstlisting}
-[ 10 ] int z;
-[ 10 ] * char w;
-* [ 10 ] double v;
+[ 5 ] int z;
+[ 5 ] * char w;
+* [ 5 ] double v;
 struct s {
 	int f0:3;
 	* int f1;
-	[ 10 ] * int f2;
+	[ 5 ] * int f2;
 };
 \end{lstlisting}
 &
 \begin{lstlisting}
-int z[ 10 ];
-char *w[ 10 ];
-double (*v)[ 10 ];
+int z[ 5 ];
+char *w[ 5 ];
+double (*v)[ 5 ];
 struct s {
 	int f0:3;
 	int *f1;
-	int *f2[ 10 ]
+	int *f2[ 5 ]
 };
 \end{lstlisting}
 &
 \begin{lstlisting}
-// array of 10 integers
-// array of 10 pointers to char
-// pointer to array of 10 doubles
+// array of 5 integers
+// array of 5 pointers to char
+// pointer to array of 5 doubles
 
 // common bit field syntax
@@ -362,15 +413,15 @@
 \begin{lstlisting}
 const * const int x;
-const * [ 10 ] const int y;
+const * [ 5 ] const int y;
 \end{lstlisting}
 &
 \begin{lstlisting}
 int const * const x;
-const int (* const y)[ 10 ]
+const int (* const y)[ 5 ]
 \end{lstlisting}
 &
 \begin{lstlisting}
 // const pointer to const integer
-// const pointer to array of 10 const integers
+// const pointer to array of 5 const integers
 \end{lstlisting}
 \end{tabular}
@@ -382,15 +433,15 @@
 \multicolumn{1}{c@{\hspace{30pt}}}{\textbf{\CFA}}	& \multicolumn{1}{c@{\hspace{20pt}}}{\textbf{C}}	\\
 \begin{lstlisting}
-extern [ 10 ] int x;
+extern [ 5 ] int x;
 static * const int y;
 \end{lstlisting}
 &
 \begin{lstlisting}
-int extern x[ 10 ];
+int extern x[ 5 ];
 const int static *y;
 \end{lstlisting}
 &
 \begin{lstlisting}
-// externally visible array of 10 integers
+// externally visible array of 5 integers
 // internally visible pointer to constant int
 \end{lstlisting}
@@ -421,10 +472,10 @@
 \begin{lstlisting}
 y = (* int)x;
-i = sizeof([ 10 ] * int);
+i = sizeof([ 5 ] * int);
 \end{lstlisting}
 &
 \begin{lstlisting}
 y = (int *)x;
-i = sizeof(int *[ 10 ]);
+i = sizeof(int *[ 5 ]);
 \end{lstlisting}
 \end{tabular}
@@ -466,7 +517,7 @@
 \CFA style declarations cannot be used to declare parameters for K\&R style routine definitions because of the following ambiguity:
 \begin{lstlisting}
-int (*f(x))[ 10 ] int x; {}
-\end{lstlisting}
-The string ``\lstinline@int (*f(x))[ 10 ]@'' declares a K\&R style routine of type returning a pointer to an array of 10 integers, while the string ``\lstinline@[ 10 ] int x@'' declares a \CFA style parameter x of type array of 10 integers.
+int (*f(x))[ 5 ] int x; {}
+\end{lstlisting}
+The string ``\lstinline@int (*f(x))[ 5 ]@'' declares a K\&R style routine of type returning a pointer to an array of 5 integers, while the string ``\lstinline@[ 5 ] int x@'' declares a \CFA style parameter x of type array of 5 integers.
 Since the strings overlap starting with the open bracket, \lstinline@[@, there is an ambiguous interpretation for the string.
 As well, \CFA-style declarations cannot be used to declare parameters for C-style routine-definitions because of the following ambiguity:
@@ -487,6 +538,6 @@
 \begin{lstlisting}
 #define ptoa( n, d ) int (*n)[ d ]
-int f( ptoa(p,10) ) ...		// expands to int f( int (*p)[ 10 ] )
-[ int ] f( ptoa(p,10) ) ...	// expands to [ int ] f( int (*p)[ 10 ] )
+int f( ptoa(p,5) ) ...		// expands to int f( int (*p)[ 5 ] )
+[ int ] f( ptoa(p,5) ) ...	// expands to [ int ] f( int (*p)[ 5 ] )
 \end{lstlisting}
 Again, programmers are highly encouraged to use one declaration form or the other, rather than mixing the forms.
@@ -807,5 +858,5 @@
 which can be used to sort in ascending and descending order by locally redefining the less-than operator into greater-than.
 \begin{lstlisting}
-const unsigned int size = 10;
+const unsigned int size = 5;
 int ia[size];
 ...						// assign values to array ia
@@ -874,5 +925,5 @@
 [ double, double, double ]
 [ * int, int * ]		// mix of CFA and ANSI
-[ * [ 10 ] int, * * char, * [ [ int, int ] ] (int, int) ]
+[ * [ 5 ] int, * * char, * [ [ int, int ] ] (int, int) ]
 \end{lstlisting}
 Like tuples, tuple types may be nested, such as \lstinline@[ [ int, int ], int ]@, which is a 2-element tuple type whose first element is itself a tuple type.
@@ -2216,8 +2267,8 @@
 
 	try {
-	throw 13;
+		throw 13;
 	}
 	catch(int e) {
-	printf(.caught an exception: %d\n., e);
+		printf(.caught an exception: %d\n., e);
 	}
 \end{lstlisting}
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/ResolvExpr/CastCost.cc	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -69,6 +69,6 @@
 		PointerType *destAsPointer = dynamic_cast< PointerType* >( dest );
 		if ( destAsPointer && basicType->isInteger() ) {
-			//cost = Cost( 1, 0, 0 );
-			cost = Cost::infinity;
+			// necessary for, e.g. unsigned long => void*
+			cost = Cost( 1, 0, 0 );
 		} else {
 			ConversionCost::visit( basicType );
@@ -89,11 +89,10 @@
 				} else if ( castResult < 0 ) {
 					cost = Cost::infinity;
-					//cost = Cost( 1, 0, 0 );
 				} // if
 			} // if
 		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
 			if ( destAsBasic->isInteger() ) {
-				//cost = Cost( 1, 0, 0 );
-				cost = Cost::infinity;
+				// necessary for, e.g. void* => unsigned long
+				cost = Cost( 1, 0, 0 );
 			} // if
 		}
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/SymTab/Indexer.cc	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -511,6 +511,7 @@
 	}
 
-	bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const {
+	bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const {
 		if ( ! tables ) return false;
+		if ( tables->scope < scope ) return false;
 
 		IdTable::const_iterator decls = tables->idTable.find( id );
@@ -524,5 +525,5 @@
 		}
 
-		return tables->base.hasIncompatibleCDecl( id, mangleName );
+		return tables->base.hasIncompatibleCDecl( id, mangleName, scope );
 	}
 	
@@ -617,6 +618,6 @@
 		DeclarationWithType *existing = lookupIdAtScope( name, mangleName, scope );
 		if ( ! existing || ! addedIdConflicts( existing, decl ) ) {
-			// this ensures that no two declarations with the same unmangled name both have C linkage
-			if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName ) ) {
+			// this ensures that no two declarations with the same unmangled name at the same scope both have C linkage
+			if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName, scope ) ) {
 				throw SemanticError( "invalid overload of C function ", decl );
 			} // NOTE this is broken in Richard's original code in such a way that it never triggers (it 
@@ -783,16 +784,25 @@
 	    using std::cerr;
 
-	    cerr << "===idTable===" << std::endl;
-	    if ( tables ) dump( tables->idTable, os );
-	    cerr << "===typeTable===" << std::endl;
-	    if ( tables ) dump( tables->typeTable, os );
-	    cerr << "===structTable===" << std::endl;
-	    if ( tables ) dump( tables->structTable, os );
-	    cerr << "===enumTable===" << std::endl;
-	    if ( tables ) dump( tables->enumTable, os );
-	    cerr << "===unionTable===" << std::endl;
-	    if ( tables ) dump( tables->unionTable, os );
-	    cerr << "===contextTable===" << std::endl;
-	    if ( tables ) dump( tables->traitTable, os );
+		if ( tables ) {
+			os << "--- scope " << tables->scope << " ---" << std::endl;
+
+			os << "===idTable===" << std::endl;
+			dump( tables->idTable, os );
+			os << "===typeTable===" << std::endl;
+			dump( tables->typeTable, os );
+			os << "===structTable===" << std::endl;
+			dump( tables->structTable, os );
+			os << "===enumTable===" << std::endl;
+			dump( tables->enumTable, os );
+			os << "===unionTable===" << std::endl;
+			dump( tables->unionTable, os );
+			os << "===contextTable===" << std::endl;
+			dump( tables->traitTable, os );
+
+			tables->base.print( os, indent );
+		} else {
+			os << "--- end ---" << std::endl;
+		}
+		
 	}
 } // namespace SymTab
Index: src/SymTab/Indexer.h
===================================================================
--- src/SymTab/Indexer.h	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/SymTab/Indexer.h	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -99,5 +99,5 @@
 		DeclarationWithType *lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
 		/// returns true if there exists a declaration with C linkage and the given name with a different mangled name
-		bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const;
+		bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
 		// equivalents to lookup functions that only look at tables at scope `scope` (which should be >= tables->scope)
 		NamedTypeDecl *lookupTypeAtScope( const std::string &id, unsigned long scope ) const;
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/SymTab/Validate.cc	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -515,5 +515,6 @@
 				}
 				rtt->get_parameters().clear();
-				cloneAll(typeInst->get_parameters(), rtt->get_parameters());
+				cloneAll( typeInst->get_parameters(), rtt->get_parameters() );
+				mutateAll( rtt->get_parameters(), *this );  // recursively fix typedefs on parameters
 			} // if
 			delete typeInst;
Index: src/driver/cfa.cc
===================================================================
--- src/driver/cfa.cc	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/driver/cfa.cc	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -10,6 +10,6 @@
 // Created On       : Tue Aug 20 13:44:49 2002
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Apr  6 14:04:22 2016
-// Update Count     : 132
+// Last Modified On : Wed Apr 20 18:31:28 2016
+// Update Count     : 133
 //
 
@@ -310,4 +310,6 @@
 			nargs += 1;
 		} // if
+		args[nargs] = "-fgnu89-inline"; 
+		nargs += 1;
 		args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str();
 		nargs += 1;
Index: src/examples/io.c
===================================================================
--- src/examples/io.c	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/examples/io.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -11,6 +11,6 @@
 // Created On       : Wed Mar  2 16:56:02 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Apr  6 14:58:27 2016
-// Update Count     : 15
+// Last Modified On : Wed Apr 13 23:03:14 2016
+// Update Count     : 22
 // 
 
@@ -36,5 +36,5 @@
 
 	ifstream in;												// create / open file
-	open( &in, "input.data", "r" );
+	open( &in, "io.data", "r" );
 
 	&in | &c													// character
@@ -59,4 +59,42 @@
 		 | fc | dc | ldc | endl									// complex without separator
 		 | s1 | s2 | endl;
+	sout | endl;
+	sepSet( sout, " " );
+
+	sout
+		// opening delimiters
+		| "v(" | 27
+		| "v[" | 27
+		| "v{" | 27
+		| "$" | 27
+		| "£" | 27
+		| "¥" | 27
+		| "¿" | 27
+		| "«" | 27
+		| endl
+		// closing delimiters
+		| 25 | ","
+		| 25 | "."
+		| 25 | ":"
+		| 25 | ";"
+		| 25 | "!"
+		| 25 | "?"
+		| 25 | ")"
+		| 25 | "]"
+		| 25 | "}"
+		| 25 | "%"
+		| 25 | "¢"
+		| 25 | "»"
+		| endl
+		// opening-closing delimiters
+		| 25 | "'" | 27
+		| 25 | "`" | 27
+		| 25 | "\"" | 27
+		| 25 | "\f" | 27
+		| 25 | "\n" | 27
+		| 25 | "\r" | 27
+		| 25 | "\t" | 27
+		| 25 | "\v" | 27
+		| endl;
 }
 
Index: src/examples/swap.c
===================================================================
--- src/examples/swap.c	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/examples/swap.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  2 16:15:11 2016
-// Update Count     : 65
+// Last Modified On : Thu Apr 21 08:10:41 2016
+// Update Count     : 69
 //
 
@@ -24,68 +24,68 @@
 
 	signed int i1 = -1, i2 = -2;
-	sout | "signed int\t\t" | i1 | ' ' | i2 | "\t\t\tswap ";
+	sout | "signed int\t\t" | i1 | i2 | "\t\t\tswap ";
 	swap( &i1, &i2 );
-	sout | '\t' | i1 | ' ' | i2 | endl;
+	sout | '\t' | i1 | i2 | endl;
 
 	unsigned int ui1 = 1, ui2 = 2;
-	sout | "unsigned int\t\t" | ui1 | ' ' | ui2 | "\t\t\tswap ";
+	sout | "unsigned int\t\t" | ui1 | ui2 | "\t\t\tswap ";
 	swap( &ui1, &ui2 );
-	sout | '\t' | ui1 | ' ' | ui2 | endl;
+	sout | '\t' | ui1 | ui2 | endl;
 
 	signed long int li1 = -1, li2 = -2;
-	sout | "signed long int\t\t" | li1 | ' ' | li2 | "\t\t\tswap ";
+	sout | "signed long int\t\t" | li1 | li2 | "\t\t\tswap ";
 	swap( &li1, &li2 );
-	sout | '\t' | li1 | ' ' | li2 | endl;
+	sout | '\t' | li1 | li2 | endl;
 
 	unsigned long int uli1 = 1, uli2 = 2;
-	sout | "unsigned long int\t" | uli1 | ' ' | uli2 | "\t\t\tswap ";
+	sout | "unsigned long int\t" | uli1 | uli2 | "\t\t\tswap ";
 	swap( &uli1, &uli2 );
-	sout | '\t' | uli1 | ' ' | uli2 | endl;
+	sout | '\t' | uli1 | uli2 | endl;
 
 	signed long long int lli1 = -1, lli2 = -2;
-	sout | "signed long long int\t" | lli1 | ' ' | lli2 | "\t\t\tswap ";
+	sout | "signed long long int\t" | lli1 | lli2 | "\t\t\tswap ";
 	swap( &lli1, &lli2 );
-	sout | '\t' | lli1 | ' ' | lli2 | endl;
+	sout | '\t' | lli1 | lli2 | endl;
 
 	unsigned long long int ulli1 = 1, ulli2 = 2;
-	sout | "unsigned long long int\t" | ulli1 | ' ' | ulli2 | "\t\t\tswap ";
+	sout | "unsigned long long int\t" | ulli1 | ulli2 | "\t\t\tswap ";
 	swap( &ulli1, &ulli2 );
-	sout | '\t' | ulli1 | ' ' | ulli2 | endl;
+	sout | '\t' | ulli1 | ulli2 | endl;
 
 	float f1 = 1.5, f2 = 2.5;
-	sout | "float\t\t\t" | f1 | ' ' | f2 | "\t\tswap ";
+	sout | "float\t\t\t" | f1 | f2 | "\t\t\tswap ";
 	swap( &f1, &f2 );
-	sout | '\t' | f1 | ' ' | f2 | endl;
+	sout | '\t' | f1 | f2 | endl;
 
 	double d1 = 1.5, d2 = 2.5;
-	sout | "double\t\t\t" | d1 | ' ' | d2 | "\t\tswap ";
+	sout | "double\t\t\t" | d1 | d2 | "\t\t\tswap ";
 	swap( &d1, &d2 );
-	sout | '\t' | d1 | ' ' | d2 | endl;
+	sout | '\t' | d1 | d2 | endl;
 
 	long double ld1 = 1.5, ld2 = 2.5;
-	sout | "long double\t\t" | ld1 | ' ' | ld2 | "\t\tswap ";
+	sout | "long double\t\t" | ld1 | ld2 | "\t\t\tswap ";
 	swap( &ld1, &ld2 );
-	sout | '\t' | ld1 | ' ' | ld2 | endl;
+	sout | '\t' | ld1 | ld2 | endl;
 
 	float _Complex fc1 = 1.5f+1.5if, fc2 = 2.5f+2.5if;
-	sout | "float _Complex\t\t" | fc1 | ' ' | fc2 | "\tswap ";
+	sout | "float _Complex\t\t" | fc1 | fc2 | "\tswap ";
 	swap( &fc1, &fc2 );
-	sout | '\t' | fc1 | ' ' | fc2 | endl;
+	sout | '\t' | fc1 | fc2 | endl;
 
 	double _Complex dc1 = 1.5d+1.5id, dc2 = 2.5d+2.5id;
-	sout | "double _Complex\t\t" | dc1 | ' ' | dc2 | "\tswap ";
+	sout | "double _Complex\t\t" | dc1 | dc2 | "\tswap ";
 	swap( &dc1, &dc2 );
-	sout | '\t' | dc1 | ' ' | dc2 | endl;
+	sout | '\t' | dc1 | dc2 | endl;
 
 	long double _Complex ldc1 = 1.5d+1.5il, ldc2 = 2.5d+2.5il;
-	sout | "long double _Complex\t" | ldc1 | ' ' | ldc2 | "\tswap ";
+	sout | "long double _Complex\t" | ldc1 | ldc2 | "\tswap ";
 	swap( &ldc1, &ldc2 );
-	sout | '\t' | ldc1 | ' ' | ldc2 | endl;
+	sout | '\t' | ldc1 | ldc2 | endl;
 
 	struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 };
-	ofstream * ?|?( ofstream * os, S s ) { return os | s.i | ' ' | s.j; }
-	sout | "struct S\t\t" | s1 | "  " | s2 | "\t\tswap ";
+	ofstream * ?|?( ofstream * os, S s ) { return os | s.i | s.j; }
+	sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap ";
 	swap( &s1, &s2 );
-	sout | '\t' | s1 | "  " | s2 | endl;
+	sout | '\t' | s1 | "," | s2 | endl;
 } // main
 
Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/Makefile.am	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 08:54:01 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Wed Apr  6 21:10:44 2016
-## Update Count     : 123
+## Last Modified On : Tue Apr 19 22:30:17 2016
+## Update Count     : 124
 ###############################################################################
 
@@ -60,5 +60,5 @@
 	${CC} ${CFLAGS} -c -o $@ $<
 
-libs = limits stdlib iostream fstream iterator rational
+libs = limits stdlib math iostream fstream iterator rational
 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
 
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/Makefile.in	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -83,6 +83,7 @@
 libcfa_a_AR = $(AR) $(ARFLAGS)
 libcfa_a_LIBADD =
-am__objects_1 = limits.$(OBJEXT) stdlib.$(OBJEXT) iostream.$(OBJEXT) \
-	fstream.$(OBJEXT) iterator.$(OBJEXT) rational.$(OBJEXT)
+am__objects_1 = limits.$(OBJEXT) stdlib.$(OBJEXT) math.$(OBJEXT) \
+	iostream.$(OBJEXT) fstream.$(OBJEXT) iterator.$(OBJEXT) \
+	rational.$(OBJEXT)
 am_libcfa_a_OBJECTS = libcfa-prelude.$(OBJEXT) $(am__objects_1)
 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
@@ -213,5 +214,5 @@
 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} \
 	${addprefix ${libdir}/,${lib_LIBRARIES}} ${includedir}/*
-libs = limits stdlib iostream fstream iterator rational
+libs = limits stdlib math iostream fstream iterator rational
 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
 cheaders = # expat
@@ -299,4 +300,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa-prelude.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limits.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rational.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdlib.Po@am__quote@
Index: src/libcfa/fstream
===================================================================
--- src/libcfa/fstream	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/fstream	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr  5 22:37:12 2016
-// Update Count     : 82
+// Last Modified On : Tue Apr 19 20:44:10 2016
+// Update Count     : 84
 //
 
@@ -22,6 +22,6 @@
 struct ofstream {
 	void *file;
-	_Bool sepDefault;
-	_Bool sepOnOff;
+	int sepDefault;
+	int sepOnOff;
 	char separator[separateSize];
 }; // ofstream
Index: src/libcfa/math
===================================================================
--- src/libcfa/math	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
+++ src/libcfa/math	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -0,0 +1,301 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// math -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Mon Apr 18 23:37:04 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Apr 21 07:56:48 2016
+// Update Count     : 38
+// 
+
+float cos( float );
+extern "C" { double cos( double ); }
+long double cos( long double );
+float _Complex cos( float _Complex );
+double _Complex cos( double _Complex );
+long double _Complex cos( long double _Complex );
+
+float cosh( float );
+extern "C" { double cosh( double ); }
+long double cosh( long double );
+float _Complex cosh( float _Complex );
+double _Complex cosh( double _Complex );
+long double _Complex cosh( long double _Complex );
+
+float acos( float );
+extern "C" { double acos( double ); }
+long double acos( long double );
+float _Complex acos( float _Complex );
+double _Complex acos( double _Complex );
+long double _Complex acos( long double _Complex );
+
+float acosh( float );
+extern "C" { double acosh( double ); }
+long double acosh( long double );
+float _Complex acosh( float _Complex );
+double _Complex acosh( double _Complex );
+long double _Complex acosh( long double _Complex );
+
+float sin( float );
+extern "C" { double sin( double ); }
+long double sin( long double );
+float _Complex sin( float _Complex );
+double _Complex sin( double _Complex );
+long double _Complex sin( long double _Complex );
+
+float sinh( float );
+extern "C" { double sinh( double ); }
+long double sinh( long double );
+float _Complex sinh( float _Complex );
+double _Complex sinh( double _Complex );
+long double _Complex sinh( long double _Complex );
+
+float asin( float );
+extern "C" { double asin( double ); }
+long double asin( long double );
+float _Complex asin( float _Complex );
+double _Complex asin( double _Complex );
+long double _Complex asin( long double _Complex );
+
+float asinh( float );
+extern "C" { double asinh( double ); }
+long double asinh( long double );
+float _Complex asinh( float _Complex );
+double _Complex asinh( double _Complex );
+long double _Complex asinh( long double _Complex );
+
+float tan( float );
+extern "C" { double tan( double ); }
+long double tan( long double );
+float _Complex tan( float _Complex );
+double _Complex tan( double _Complex );
+long double _Complex tan( long double _Complex );
+
+float tanh( float );
+extern "C" { double tanh( double ); }
+long double tanh( long double );
+float _Complex tanh( float _Complex );
+double _Complex tanh( double _Complex );
+long double _Complex tanh( long double _Complex );
+
+float atan( float );
+extern "C" { double atan( double ); }
+long double atan( long double );
+float _Complex atan( float _Complex );
+double _Complex atan( double _Complex );
+long double _Complex atan( long double _Complex );
+
+float _Complex atan( float, float );
+double atan( double, double );
+long double atan( long double, long double );
+
+float atanh( float );
+extern "C" { double atanh( double ); }
+long double atanh( long double );
+float _Complex atanh( float _Complex );
+double _Complex atanh( double _Complex );
+long double _Complex atanh( long double _Complex );
+
+float exp( float );
+extern "C" { double exp( double ); }
+long double exp( long double );
+float _Complex exp( float _Complex );
+double _Complex exp( double _Complex );
+long double _Complex exp( long double _Complex );
+
+float log( float );
+extern "C" { double log( double ); }
+long double log( long double );
+float _Complex log( float _Complex );
+double _Complex log( double _Complex );
+long double _Complex log( long double _Complex );
+
+float pow( float, float );
+extern "C" { double pow( double, double ); }
+long double pow( long double, long double );
+float _Complex pow( float _Complex, float _Complex );
+double _Complex pow( double _Complex, double _Complex );
+long double _Complex pow( long double _Complex, long double _Complex );
+
+float sqrt( float );
+extern "C" { double sqrt( double ); }
+long double sqrt( long double );
+float _Complex sqrt( float _Complex );
+double _Complex sqrt( double _Complex );
+long double _Complex sqrt( long double _Complex );
+
+float fabs( float );
+extern "C" { double fabs( double ); }
+long double fabs( long double );
+float cabs( float _Complex );
+extern "C" { double cabs( double _Complex ); }
+long double cabs( long double _Complex );
+
+float floor( float );
+extern "C" { double floor( double ); }
+long double floor( long double );
+
+float ceil( float );
+extern "C" { double ceil( double ); }
+long double ceil( long double );
+
+//---------------------------------------
+
+float cbrt( float );
+extern "C" { double cbrt( double ); }
+long double cbrt( long double );
+
+float copysign( float, float );
+extern "C" { double copysign( double, double ); }
+long double copysign( long double, long double );
+
+float erf( float );
+extern "C" { double erf( double ); }
+long double erf( long double );
+
+float erfc( float );
+extern "C" { double erfc( double ); }
+long double erfc( long double );
+
+float exp2( float );
+extern "C" { double exp2( double ); }
+long double exp2( long double );
+
+float expm1( float );
+extern "C" { double expm1( double ); }
+long double expm1( long double );
+
+float fdim( float, float );
+extern "C" { double fdim( double, double ); }
+long double fdim( long double, long double );
+
+float fma( float, float, float );
+extern "C" { double fma( double, double, double ); }
+long double fma( long double, long double, long double );
+
+float ?%?( float, float );
+float fmod( float, float );
+double ?%?( double, double );
+extern "C" { double fmod( double, double ); }
+long double ?%?( long double, long double );
+long double fmod( long double, long double );
+
+[ int, float ] div( float x );
+float frexp( float, int * );
+[ int, double ] div( double x );
+extern "C" { double frexp( double, int * ); }
+[ int, long double ] div( long double x );
+long double frexp( long double, int * );
+
+float hypot( float, float );
+extern "C" { double hypot( double, double ); }
+long double hypot( long double, long double );
+
+int ilogb( float );
+extern "C" { int ilogb( double ); }
+int ilogb( long double );
+
+float ldexp( float, int );
+extern "C" { double ldexp( double, int ); }
+long double ldexp( long double, int );
+
+float lgamma( float );
+extern "C" { double lgamma( double ); }
+long double lgamma( long double );
+
+float rint( float x );
+long double rint( long double x );
+long int rint( float x );
+long int rint( double x );
+long int rint( long double x );
+long long int rint( float x );
+long long int rint( double x );
+long long int rint( long double x );
+
+long int lrint( float );
+extern "C" { long int lrint( double ); }
+long int lrint( long double );
+long long int llrint( float );
+extern "C" { long long int llrint( double ); }
+long long int llrint( long double );
+
+float round( float x );
+long double round( long double x );
+long int round( float x );
+long int round( double x );
+long int round( long double x );
+long long int round( float x );
+long long int round( double x );
+long long int round( long double x );
+
+long int lround( float );
+extern "C" { long int lround( double ); }
+long int lround( long double );
+long long int llround( float );
+extern "C" { long long int llround( double ); }
+long long int llround( long double );
+
+float log10( float );
+extern "C" { double log10( double ); }
+long double log10( long double );
+
+float log1p( float );
+extern "C" { double log1p( double ); }
+long double log1p( long double );
+
+float log2( float );
+extern "C" { double log2( double ); }
+long double log2( long double );
+
+float logb( float );
+extern "C" { double logb( double ); }
+long double logb( long double );
+
+float nearbyint( float );
+extern "C" { double nearbyint( double ); }
+long double nearbyint( long double );
+
+float nextafter( float, float );
+extern "C" { double nextafter( double, double ); }
+long double nextafter( long double, long double );
+
+float nexttoward( float, long double );
+extern "C" { double nexttoward( double, long double ); }
+long double nexttoward( long double, long double );
+
+float remainder( float, float );
+extern "C" { double remainder( double, double ); }
+long double remainder( long double, long double );
+
+[ int, float ] remquo( float x, float y );
+float remquo( float, float, int * );
+[ int, double ] remquo( double x, double y );
+extern "C" { double remquo( double, double, int * ); }
+[ int, long double ] remquo( long double x, long double y );
+long double remquo( long double, long double, int * );
+
+float scalbn( float, int );
+extern "C" { double scalbn( double, int ); }
+long double scalbn( long double, int );
+
+float scalbln( float, long int );
+extern "C" { double scalbln( double, long int ); }
+long double scalbln( long double, long int );
+
+float tgamma( float );
+extern "C" { double tgamma( double ); }
+long double tgamma( long double );
+
+float trunc( float );
+extern "C" { double trunc( double ); }
+long double trunc( long double );
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/math.c
===================================================================
--- src/libcfa/math.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
+++ src/libcfa/math.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -0,0 +1,263 @@
+//                               -*- Mode: C -*- 
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// math.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Tue Apr 19 22:23:08 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Thu Apr 21 07:56:49 2016
+// Update Count     : 51
+// 
+
+#include "math"
+
+//---------------------------------------
+
+extern "C" {
+#include <math.h>
+#include <complex.h>
+} // extern "C"
+
+float cos( float x ) { return cosf( x ); }
+long double cos( long double x ) { return cosl( x ); }
+float _Complex cos( float _Complex x ) { return ccosf( x ); }
+double _Complex cos( double _Complex x ) { return ccos( x ); }
+long double _Complex cos( long double _Complex x ) { return ccosl( x ); }
+
+float cosh( float x ) { return coshf( x ); }
+long double cosh( long double x ) { return coshl( x ); }
+float _Complex cosh( float _Complex x ) { return ccoshf( x ); }
+double _Complex cosh( double _Complex x ) { return ccosh( x ); }
+long double _Complex cosh( long double _Complex x ) { return ccoshl( x ); }
+
+float acos( float x ) { return acosf( x ); }
+long double acos( long double x ) { return acosl( x ); }
+float _Complex acos( float _Complex x ) { return cacosf( x ); }
+double _Complex acos( double _Complex x ) { return cacos( x ); }
+long double _Complex acos( long double _Complex x ) { return cacosl( x ); }
+
+float acosh( float x ) { return acoshf( x ); }
+long double acosh( long double x ) { return acoshl( x ); }
+float _Complex acosh( float _Complex x ) { return cacoshf( x ); }
+double _Complex acosh( double _Complex x ) { return cacosh( x ); }
+long double _Complex acosh( long double _Complex x ) { return cacoshl( x ); }
+
+float sin( float x ) { return sinf( x ); }
+long double sin( long double x ) { return sinl( x ); }
+float _Complex sin( float _Complex x ) { return csinf( x ); }
+double _Complex sin( double _Complex x ) { return csin( x ); }
+long double _Complex sin( long double _Complex x ) { return csinl( x ); }
+
+float sinh( float x ) { return sinhf( x ); }
+long double sinh( long double x ) { return sinhl( x ); }
+float _Complex sinh( float _Complex x ) { return csinhf( x ); }
+double _Complex sinh( double _Complex x ) { return csinh( x ); }
+long double _Complex sinh( long double _Complex x ) { return csinhl( x ); }
+
+float asin( float x ) { return asinf( x ); }
+long double asin( long double x ) { return asinl( x ); }
+float _Complex asin( float _Complex x ) { return casinf( x ); }
+double _Complex asin( double _Complex x ) { return casin( x ); }
+long double _Complex asin( long double _Complex x ) { return casinl( x ); }
+
+float asinh( float x ) { return asinhf( x ); }
+long double asinh( long double x ) { return asinhl( x ); }
+float _Complex asinh( float _Complex x ) { return casinhf( x ); }
+double _Complex asinh( double _Complex x ) { return casinh( x ); }
+long double _Complex asinh( long double _Complex x ) { return casinhl( x ); }
+
+float tan( float x ) { return tanf( x ); }
+long double tan( long double x ) { return tanl( x ); }
+float _Complex tan( float _Complex x ) { return ctanf( x ); }
+double _Complex tan( double _Complex x ) { return ctan( x ); }
+long double _Complex tan( long double _Complex x ) { return ctanl( x ); }
+
+float tanh( float x ) { return tanhf( x ); }
+long double tanh( long double x ) { return tanhl( x ); }
+float _Complex tanh( float _Complex x ) { return ctanhf( x ); }
+double _Complex tanh( double _Complex x ) { return ctanh( x ); }
+long double _Complex tanh( long double _Complex x ) { return ctanhl( x ); }
+
+float atan( float x ) { return atanf( x ); }
+long double atan( long double x ) { return atanl( x ); }
+float _Complex atan( float _Complex x ) { return catanf( x ); }
+double _Complex atan( double _Complex x ) { return catan( x ); }
+long double _Complex atan( long double _Complex x ) { return catanl( x ); }
+
+float atan( float x, float y ) { return atan2f( x, y ); }
+double atan( double x, double y ) { return atan2( x, y ); }
+long double atan( long double x, long double y ) { return atan2l( x, y ); }
+
+float atanh( float x ) { return atanhf( x ); }
+long double atanh( long double x ) { return atanhl( x ); }
+float _Complex atanh( float _Complex x ) { return catanhf( x ); }
+double _Complex atanh( double _Complex x ) { return catanh( x ); }
+long double _Complex atanh( long double _Complex x ) { return catanhl( x ); }
+
+float exp( float x ) { return expf( x ); }
+long double exp( long double x ) { return expl( x ); }
+float _Complex exp( float _Complex x ) { return cexpf( x ); }
+double _Complex exp( double _Complex x ) { return cexp( x ); }
+long double _Complex exp( long double _Complex x ) { return cexpl( x ); }
+
+float log( float x ) { return logf( x ); }
+long double log( long double x ) { return logl( x ); }
+float _Complex log( float _Complex x ) { return clogf( x ); }
+double _Complex log( double _Complex x ) { return clog( x ); }
+long double _Complex log( long double _Complex x ) { return clogl( x ); }
+
+float pow( float x, float y ) { return powf( x, y ); }
+long double pow( long double x, long double y ) { return powl( x, y ); }
+float _Complex pow( float _Complex x, float _Complex y ) { return cpowf( x, y ); }
+double _Complex pow( double _Complex x, double _Complex y ) { return cpow( x, y ); }
+long double _Complex pow( long double _Complex x, long double _Complex y ) { return cpowl( x, y ); }
+
+float sqrt( float x ) { return sqrtf( x ); }
+long double sqrt( long double x ) { return sqrtl( x ); }
+float _Complex sqrt( float _Complex x ) { return csqrtf( x ); }
+double _Complex sqrt( double _Complex x ) { return csqrt( x ); }
+long double _Complex sqrt( long double _Complex x ) { return csqrtl( x ); }
+
+float fabs( float x ) { return fabsf( x ); }
+long double fabs( long double x ) { return fabsl( x ); }
+float cabs( float _Complex x ) { return cabsf( x ); }
+long double cabs( long double _Complex x ) { return cabsl( x ); }
+
+float floor( float x ) { return floorf( x ); }
+long double floor( long double x ) { return floorl( x ); }
+
+float ceil( float x ) { return ceilf( x ); }
+long double ceil( long double x ) { return ceill( x ); }
+
+//---------------------------------------
+
+float cbrt( float x ) { return cbrtf( x ); }
+long double cbrt( long double x ) { return cbrtl( x ); }
+
+float copysign( float x, float y ) { return copysignf( x, y ); }
+long double copysign( long double x, long double y ) { return copysignl( x, y ); }
+
+float erf( float x ) { return erff( x ); }
+long double erf( long double x ) { return erfl( x ); }
+
+float erfc( float x ) { return erfcf( x ); }
+long double erfc( long double x ) { return erfcl( x ); }
+
+float exp2( float x ) { return exp2f( x ); }
+long double exp2( long double x ) { return exp2l( x ); }
+
+float expm1( float x ) { return expm1f( x ); }
+long double expm1( long double x ) { return expm1l( x ); }
+
+float fdim( float x, float y ) { return fdimf( x, y ); }
+long double fdim( long double x, long double y ) { return fdiml( x, y ); }
+
+float fma( float x, float y, float z ) { return fmaf( x, y, z ); }
+long double fma( long double x, long double y, long double z ) { return fmal( x, y, z ); }
+
+float ?%?( float x, float y ) { return fmodf( x, y ); }
+float fmod( float x, float y ) { return fmodf( x, y ); }
+double ?%?( double x, double y ) { return fmod( x, y ); }
+long double ?%?( long double x, long double y ) { return fmodl( x, y ); }
+long double fmod( long double x, long double y ) { return fmodl( x, y ); }
+
+//[ int, float ] div( float x ) { int i; x = frexpf( x, &i ); return [ i, x ]; }
+float frexp( float x, int *ip ) { return frexpf( x, ip ); }
+//[ int, double ] div( double x ) { int i; x = frexp( x, &i ); return [ i, x ]; }
+//[ int, long double ] div( long double x ) { int i; x = frexpl( x, &i ); return [ i, x ]; }
+long double frexp( long double x, int *ip ) { return frexpl( x, ip ); }
+
+float hypot( float x, float y ) { return hypotf( x, y ); }
+long double hypot( long double x, long double y ) { return hypotl( x, y ); }
+
+int ilogb( float x ) { return ilogbf( x ); }
+int ilogb( long double x ) { return ilogbl( x ); }
+
+float ldexp( float x, int exp2 ) { return ldexpf( x, exp2 ); }
+long double ldexp( long double x, int exp2 ) { return ldexpl( x, exp2 ); }
+
+float lgamma( float x ) { return lgammaf( x ); }
+long double lgamma( long double x ) { return lgammal( x ); }
+
+float rint( float x ) { return rintf( x ); }
+long double rint( long double x ) { return rintl( x ); }
+long int rint( float x ) { return lrintf( x ); }
+long int rint( double x ) { return lrint( x ); }
+long int rint( long double x ) { return lrintl( x ); }
+long long int rint( float x ) { return llrintf( x ); }
+long long int rint( double x ) { return llrint( x ); }
+long long int rint( long double x ) { return llrintl( x ); }
+
+long int lrint( float x ) { return lrintf( x ); }
+long int lrint( long double x ) { return lrintl( x ); }
+long long int llrint( float x ) { return llrintf( x ); }
+long long int llrint( long double x ) { return llrintl( x ); }
+
+float round( float x ) { return roundf( x ); }
+long double round( long double x ) { return roundl( x ); }
+long int round( float x ) { return lroundf( x ); }
+long int round( double x ) { return lround( x ); }
+long int round( long double x ) { return lroundl( x ); }
+long long int round( float x ) { return llroundf( x ); }
+long long int round( double x ) { return llround( x ); }
+long long int round( long double x ) { return llroundl( x ); }
+
+long int lround( float x ) { return lroundf( x ); }
+long int lround( long double x ) { return lroundl( x ); }
+long long int llround( float x ) { return llroundf( x ); }
+long long int llround( long double x ) { return llroundl( x ); }
+
+float log10( float x ) { return log10f( x ); }
+long double log10( long double x ) { return log10l( x ); }
+
+float log1p( float x ) { return log1pf( x ); }
+long double log1p( long double x ) { return log1pl( x ); }
+
+float log2( float x ) { return log2f( x ); }
+long double log2( long double x ) { return log2l( x ); }
+
+float logb( float x ) { return logbf( x ); }
+long double logb( long double x ) { return logbl( x ); }
+
+float nearbyint( float x ) { return nearbyintf( x ); }
+long double nearbyint( long double x ) { return nearbyintl( x ); }
+
+float nextafter( float x, float y ) { return nextafterf( x, y ); }
+long double nextafter( long double x, long double y ) { return nextafterl( x, y ); }
+
+float nexttoward( float x, long double y ) { return nexttowardf( x, y ); }
+long double nexttoward( long double x, long double y ) { return nexttowardl( x, y ); }
+
+float remainder( float x, float y ) { return remainderf( x, y ); }
+long double remainder( long double x, long double y ) { return remainderl( x, y ); }
+
+//[ int, float ] remquo( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }
+float remquo( float x, float y, int *quo ) { return remquof( x, y, quo ); }
+//[ int, double ] remquo( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }
+//[ int, long double ] remquo( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }
+long double remquo( long double x, long double y, int *quo ) { return remquol( x, y, quo ); }
+
+float scalbn( float x, int exp ) { return scalbnf( x, exp ); }
+long double scalbn( long double x, int exp ) { return scalbnl( x, exp ); }
+float scalbn( float x, long int exp ) { return scalblnf( x, exp ); }
+double scalbn( double x, long int exp ) { return scalbln( x, exp ); }
+long double scalbn( long double x, long int exp ) { return scalblnl( x, exp ); }
+
+float scalbln( float x, long int exp ) { return scalblnf( x, exp ); }
+long double scalbln( long double x, long int exp ) { return scalblnl( x, exp ); }
+
+float tgamma( float x ) { return tgammaf( x ); }
+long double tgamma( long double x ) { return tgammal( x ); }
+
+float trunc( float x ) { return truncf( x ); }
+long double trunc( long double x ) { return truncl( x ); }
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/rational.c
===================================================================
--- src/libcfa/rational.c	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/rational.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -11,6 +11,6 @@
 // Created On       : Wed Apr  6 17:54:28 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 12 21:26:42 2016
-// Update Count     : 21
+// Last Modified On : Thu Apr 21 07:33:03 2016
+// Update Count     : 22
 // 
 
@@ -18,4 +18,5 @@
 #include "fstream"
 #include "stdlib"
+#include "math"											// floor
 
 
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/stdlib	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Apr 13 14:45:53 2016
-// Update Count     : 85
+// Last Modified On : Thu Apr 21 07:55:21 2016
+// Update Count     : 95
 //
 
@@ -28,31 +28,28 @@
 #endif // ! EXIT_FAILURE
 void exit( int rc );
+void abort( void );
 } // extern "C"
 
 //---------------------------------------
 
-extern "C" {
-void * malloc( size_t );								// use default C routine for void *
-} // extern "C"
+extern "C" { void * malloc( size_t ); }					// use default C routine for void *
 forall( otype T ) T * malloc( void );
 forall( otype T ) T * malloc( char fill );
 forall( otype T ) T * malloc( T * ptr, size_t size );
 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
-extern "C" {
-void * calloc( size_t nmemb, size_t size );				// use default C routine for void *
-} // extern "C"
+extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
 forall( otype T ) T * calloc( size_t nmemb );
-extern "C" {
-void * realloc( void * ptr, size_t size );				// use default C routine for void *
-} // extern "C"
+extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
 forall( otype T ) T * realloc( T * ptr, size_t size );
 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
 
 forall( otype T ) T * aligned_alloc( size_t alignment );
-forall( otype T ) T * memalign( size_t alignment );		// deprecated
+forall( otype T ) T * memalign( size_t alignment );
 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
 
-forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
-forall( otype T ) T * memset( T * ptr );				// remove when default value available
+extern "C" {
+void * memset( void * ptr, int fill, size_t size );
+void free( void * ptr );
+} // extern "C"
 
 //---------------------------------------
@@ -100,7 +97,5 @@
 
 char abs( char );
-extern "C" {
-int abs( int );											// use default C routine for int
-} // extern "C"
+extern "C" { int abs( int ); }							// use default C routine for int
 long int abs( long int );
 long long int abs( long long int );
@@ -108,21 +103,7 @@
 double abs( double );
 long double abs( long double );
-float _Complex abs( float _Complex );
-double _Complex abs( double _Complex );
-long double _Complex abs( long double _Complex );
-
-//---------------------------------------
-
-float floor( float );
-extern "C" {
-double floor( double );									// use C routine for double
-} // extern "C"
-long double floor( long double );
-
-float ceil( float );
-extern "C" {
-double ceil( double );									// use C routine for double
-} // extern "C"
-long double ceil( long double );
+float abs( float _Complex );
+double abs( double _Complex );
+long double abs( long double _Complex );
 
 //---------------------------------------
Index: src/libcfa/stdlib.c
===================================================================
--- src/libcfa/stdlib.c	(revision dc2e7e0625c69ea1a4e1ba396569d2cd6cec9f99)
+++ src/libcfa/stdlib.c	(revision fbfb38e115e532f4ffb93eb36c9df8163dd09f7d)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Apr 13 14:49:58 2016
-// Update Count     : 155
+// Last Modified On : Thu Apr 21 07:58:29 2016
+// Update Count     : 165
 //
 
@@ -24,5 +24,5 @@
 #include <malloc.h>										// malloc_usable_size
 #include <math.h>										// fabsf, fabs, fabsl
-#include <complex.h>									// _Complex_I, cabsf, cabs, cabsl
+#include <complex.h>									// _Complex_I
 } // extern "C"
 
@@ -34,5 +34,5 @@
 	//printf( "malloc3\n" );
 	T * ptr = (T *)malloc( sizeof(T) );
-    return memset( ptr );
+    return memset( ptr, (int)fill, sizeof(T) );
 } // malloc
 
@@ -78,43 +78,34 @@
 } // posix_memalign
 
-forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill
-	//printf( "memset1\n" );
-    return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) );
-} // memset
-forall( otype T ) T * memset( T * ptr ) {				// remove when default value available
-	//printf( "memset2\n" );
-    return (T *)memset( ptr, 0, malloc_usable_size( ptr ) );
-} // memset
-
 //---------------------------------------
 
 int ato( const char * ptr ) {
 	int i;
-	if ( sscanf( ptr, "%d", &i ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%d", &i ) == EOF ) {}
 	return i;
 }
 unsigned int ato( const char * ptr ) {
 	unsigned int ui;
-	if ( sscanf( ptr, "%u", &ui ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%u", &ui ) == EOF ) {}
 	return ui;
 }
 long int ato( const char * ptr ) {
 	long int li;
-	if ( sscanf( ptr, "%ld", &li ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%ld", &li ) == EOF ) {}
 	return li;
 }
 unsigned long int ato( const char * ptr ) {
 	unsigned long int uli;
-	if ( sscanf( ptr, "%lu", &uli ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%lu", &uli ) == EOF ) {}
 	return uli;
 }
 long long int ato( const char * ptr ) {
 	long long int lli;
-	if ( sscanf( ptr, "%lld", &lli ) == EOF ) {}		// check return code
+	if ( sscanf( ptr, "%lld", &lli ) == EOF ) {}
 	return lli;
 }
 unsigned long long int ato( const char * ptr ) {
 	unsigned long long int ulli;
-	if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {}		// check return code
+	if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {}
 	return ulli;
 }
@@ -122,15 +113,15 @@
 float ato( const char * ptr ) {
 	float f;
-	if ( sscanf( ptr, "%f", &f ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%f", &f ) == EOF ) {}
 	return f;
 }
 double ato( const char * ptr ) {
 	double d;
-	if ( sscanf( ptr, "%lf", &d ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%lf", &d ) == EOF ) {}
 	return d;
 }
 long double ato( const char * ptr ) {
 	long double ld;
-	if ( sscanf( ptr, "%Lf", &ld ) == EOF ) {}			// check return code
+	if ( sscanf( ptr, "%Lf", &ld ) == EOF ) {}
 	return ld;
 }
@@ -138,15 +129,15 @@
 float _Complex ato( const char * ptr ) {
 	float re, im;
-	if ( sscanf( ptr, "%g%gi", &re, &im ) == EOF ) {}	// check return code
+	if ( sscanf( ptr, "%g%gi", &re, &im ) == EOF ) {}
 	return re + im * _Complex_I;
 }
 double _Complex ato( const char * ptr ) {
 	double re, im;
-	if ( sscanf( ptr, "%lf%lfi", &re, &im ) == EOF ) {} // check return code
+	if ( sscanf( ptr, "%lf%lfi", &re, &im ) == EOF ) {}
 	return re + im * _Complex_I;
 }
 long double _Complex ato( const char * ptr ) {
 	long double re, im;
-	if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {}	// check return code
+	if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {}
 	return re + im * _Complex_I;
 }	
@@ -230,18 +221,10 @@
 long int abs( long int v ) { return labs( v ); }
 long long int abs( long long int v ) { return llabs( v ); }
-float abs( float v ) { return fabsf( v ); }
-double abs( double v ) { return fabs( v ); }
-long double abs( long double v ) { return fabsl( v ); }
-float _Complex abs( float _Complex v ) { return cabsf( v ); }
-double _Complex abs( double _Complex v ) { return cabs( v ); }
-long double _Complex abs( long double _Complex v ) { return cabsl( v ); }
-
-//---------------------------------------
-
-float floor( float v ) { return floorf( v ); }
-long double floor( long double v ) { return floorl( v ); }
-
-float ceil( float v ) { return ceilf( v ); }
-long double ceil( long double v ) { return ceill( v ); }
+float abs( float x ) { return fabsf( x ); }
+double abs( double x ) { return fabs( x ); }
+long double abs( long double x ) { return fabsl( x ); }
+float abs( float _Complex x ) { return cabsf( x ); }
+double abs( double _Complex x ) { return cabs( x ); }
+long double abs( long double _Complex x ) { return cabsl( x ); }
 
 //---------------------------------------
