Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision 784deab79c9d58f003b487276e5bf683364fc75c)
+++ src/libcfa/Makefile.am	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -11,9 +11,8 @@
 ## Created On       : Sun May 31 08:54:01 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Wed Dec 16 22:58:17 2015
-## Update Count     : 9
+## Last Modified On : Fri Jan 29 11:39:09 2016
+## Update Count     : 108
 ###############################################################################
 
-libcfa_a_SOURCES = libcfa-prelude.c
 lib_LIBRARIES = libcfa.a
 
@@ -41,9 +40,27 @@
 prototypes.awk :
 
-MAINTAINERCLEANFILES = ${srcdir}/libcfa-prelude.c
+MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
+
+#--------------------------------------------------
 
 libcfa-prelude.c : ${srcdir}/prelude.cf
-	../cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
+	${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
 
 libcfa-prelude.o : libcfa-prelude.c
-	${BACKEND_CC} -c -o $@ $<
+	@BACKEND_CC@ -c -o $@ $<
+
+CFLAGS = -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
+CC = ${abs_top_srcdir}/src/driver/cfa 
+
+# extension-less header files are overridden by default make rules => explicitly override rule
+% : %.c
+	true
+
+libs = algorithm iostream fstream iterator
+libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
+
+cheaders = bfd bfdlink demangle dialog evdns evhttp evrpc expat fcntl form gcrypt math
+cfaheaders = limits
+include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders}
+
+MAINTAINERCLEANFILES += ${includedir}/*
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 784deab79c9d58f003b487276e5bf683364fc75c)
+++ src/libcfa/Makefile.in	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -18,4 +18,5 @@
 ######################## -*- Mode: Makefile-Automake -*- ######################
 ###############################################################################
+
 
 
@@ -38,5 +39,6 @@
 POST_UNINSTALL = :
 subdir = src/libcfa
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -74,5 +76,6 @@
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfalibdir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfalibdir)" \
+	"$(DESTDIR)$(includedir)"
 LIBRARIES = $(lib_LIBRARIES)
 AR = ar
@@ -80,5 +83,7 @@
 libcfa_a_AR = $(AR) $(ARFLAGS)
 libcfa_a_LIBADD =
-am_libcfa_a_OBJECTS = libcfa-prelude.$(OBJEXT)
+am__objects_1 = algorithm.$(OBJEXT) iostream.$(OBJEXT) \
+	fstream.$(OBJEXT) iterator.$(OBJEXT)
+am_libcfa_a_OBJECTS = libcfa-prelude.$(OBJEXT) $(am__objects_1)
 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -93,4 +98,5 @@
 DIST_SOURCES = $(libcfa_a_SOURCES)
 DATA = $(cfalib_DATA)
+HEADERS = $(include_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -104,5 +110,5 @@
 AWK = @AWK@
 BACKEND_CC = @BACKEND_CC@
-CC = @CC@
+CC = ${abs_top_srcdir}/src/driver/cfa 
 CCDEPMODE = @CCDEPMODE@
 CFA_BINDIR = @CFA_BINDIR@
@@ -110,5 +116,5 @@
 CFA_LIBDIR = @CFA_LIBDIR@
 CFA_PREFIX = @CFA_PREFIX@
-CFLAGS = @CFLAGS@
+CFLAGS = -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -200,5 +206,4 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-libcfa_a_SOURCES = libcfa-prelude.c
 lib_LIBRARIES = libcfa.a
 
@@ -206,5 +211,11 @@
 cfalibdir = ${libdir}
 cfalib_DATA = prelude.cf builtins.cf
-MAINTAINERCLEANFILES = ${srcdir}/libcfa-prelude.c
+MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} \
+	${addprefix ${libdir}/,${lib_LIBRARIES}} ${includedir}/*
+libs = algorithm iostream fstream iterator
+libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
+cheaders = bfd bfdlink demangle dialog evdns evhttp evrpc expat fcntl form gcrypt math
+cfaheaders = limits
+include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders}
 all: all-am
 
@@ -220,7 +231,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/libcfa/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcfa/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/libcfa/Makefile
+	  $(AUTOMAKE) --gnu src/libcfa/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -282,4 +293,8 @@
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/algorithm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iostream.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iterator.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa-prelude.Po@am__quote@
 
@@ -315,4 +330,22 @@
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(cfalibdir)'; $(am__uninstall_files_from_dir)
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -400,7 +433,7 @@
 check-am: all-am
 check: check-am
-all-am: Makefile $(LIBRARIES) $(DATA)
+all-am: Makefile $(LIBRARIES) $(DATA) $(HEADERS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfalibdir)"; do \
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfalibdir)" "$(DESTDIR)$(includedir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
@@ -458,5 +491,5 @@
 info-am:
 
-install-data-am: install-cfalibDATA
+install-data-am: install-cfalibDATA install-includeHEADERS
 
 install-dvi: install-dvi-am
@@ -503,5 +536,6 @@
 ps-am:
 
-uninstall-am: uninstall-cfalibDATA uninstall-libLIBRARIES
+uninstall-am: uninstall-cfalibDATA uninstall-includeHEADERS \
+	uninstall-libLIBRARIES
 
 .MAKE: install-am install-strip
@@ -513,10 +547,11 @@
 	install-data install-data-am install-dvi install-dvi-am \
 	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-libLIBRARIES install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-cfalibDATA \
+	install-includeHEADERS install-info install-info-am \
+	install-libLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-cfalibDATA uninstall-includeHEADERS \
 	uninstall-libLIBRARIES
 
@@ -541,9 +576,15 @@
 prototypes.awk :
 
+#--------------------------------------------------
+
 libcfa-prelude.c : ${srcdir}/prelude.cf
-	../cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
+	${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@  # use src/cfa-cpp as not in lib until after install
 
 libcfa-prelude.o : libcfa-prelude.c
-	${BACKEND_CC} -c -o $@ $<
+	@BACKEND_CC@ -c -o $@ $<
+
+# extension-less header files are overridden by default make rules => explicitly override rule
+% : %.c
+	true
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
Index: src/libcfa/algorithm
===================================================================
--- src/libcfa/algorithm	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/algorithm	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,38 @@
+//
+// 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.
+//
+// alorgithm -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Jan 28 17:12:35 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jan 29 14:57:51 2016
+// Update Count     : 20
+//
+
+forall( type T | { int ?<?( T, T ); } )
+T min( const T t1, const T t2 );
+
+forall( type T | { int ?>?( T, T ); } )
+T max( const T t1, const T t2 );
+
+char abs( char );
+extern "C" {
+int abs( int );
+} // extern
+long int abs( long int );
+long long int abs( long long int );
+float abs( float );
+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 );
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/algorithm.c
===================================================================
--- src/libcfa/algorithm.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/algorithm.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,48 @@
+//
+// 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.
+//
+// algorithm.c -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Jan 28 17:10:29 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jan 29 15:49:59 2016
+// Update Count     : 29
+//
+
+#include "algorithm"
+
+forall( type T | { int ?<?( T, T ); } )
+T min( const T t1, const T t2 ) {
+	return t1 < t2 ? t1 : t2;
+} // min
+
+forall( type T | { int ?>?( T, T ); } )
+T max( const T t1, const T t2 ) {
+	return t1 > t2 ? t1 : t2;
+} // max
+
+
+extern "C" {
+#include <stdlib.h>										// abs, labs, llabs
+#include <math.h>										// fabsf, fabs, fabsl
+#include <complex.h>									// cabsf, cabs, cabsl
+} // extern
+
+char abs( char v ) { return abs( (int)v ); }
+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 ); }
+
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/bfd.h
===================================================================
--- src/libcfa/bfd.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/bfd.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bfd.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Thu Jan  8 15:50:56 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:44:41 2015
+// Update Count     : 9
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_BFD_H__
+#endif // ! type
+
+#include_next <bfd.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_BFD_H__ )			// reset only if set
+#undef type
+#undef __CFA_BFD_H__
+#endif // type && __CFA_BFD_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/bfdlink.h
===================================================================
--- src/libcfa/bfdlink.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/bfdlink.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// bfdlink.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sat Jun 27 09:14:00 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:47:03 2015
+// Update Count     : 4
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_BFDLINK_H__
+#endif // ! type
+
+#include_next <bfdlink.h>								// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_BFDLINK_H__ )		// reset only if set
+#undef type
+#undef __CFA_BFDLINK_H__
+#endif // type && __CFA_BFDLINK_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/demangle.h
===================================================================
--- src/libcfa/demangle.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/demangle.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// demangle.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sat Jun 27 16:45:01 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:48:30 2015
+// Update Count     : 9
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_DEMANGLE_H__
+#endif // ! type
+
+#include_next <demangle.h>								// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_DEMANGLE_H__ )		// reset only if set
+#undef type
+#undef __CFA_DEMANGLE_H__
+#endif // type && __CFA_DEMANGLE_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/dialog.h
===================================================================
--- src/libcfa/dialog.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/dialog.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// dialog.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 08:34:16 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:38:21 2015
+// Update Count     : 11
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_DIALOG_H__
+#endif // ! type
+
+#include_next <dialog.h>								// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_DIALOG_H__ )		// reset only if set
+#undef type
+#undef __CFA_DIALOG_H__
+#endif // type && __CFA_DIALOG_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/evdns.h
===================================================================
--- src/libcfa/evdns.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/evdns.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// evdns.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 10:09:23 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:51:06 2015
+// Update Count     : 3
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_EVDNS_H__
+#endif // ! type
+
+#include_next <evdns.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_EVDNS_H__ )		// reset only if set
+#undef type
+#undef __CFA_EVDNS_H__
+#endif // type && __CFA_EVDNS_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/evhttp.h
===================================================================
--- src/libcfa/evhttp.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/evhttp.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// evhttp.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 10:59:02 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:52:19 2015
+// Update Count     : 2
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_EVHTTP_H__
+#endif // ! type
+
+#include_next <evhttp.h>								// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_EVHTTP_H__ )		// reset only if set
+#undef type
+#undef __CFA_EVHTTP_H__
+#endif // type && __CFA_EVHTTP_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/evrpc.h
===================================================================
--- src/libcfa/evrpc.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/evrpc.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// evrpc.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 11:01:31 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:53:14 2015
+// Update Count     : 2
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_EVRPC_H__
+#endif // ! type
+
+#include_next <evrpc.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_EVRPC_H__ )		// reset only if set
+#undef type
+#undef __CFA_EVRPC_H__
+#endif // type && __CFA_EVRPC_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/expat.h
===================================================================
--- src/libcfa/expat.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/expat.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,43 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// expat.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 11:10:15 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:57:26 2015
+// Update Count     : 4
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_EXPAT1_H__
+#endif // ! type
+
+#if ! defined( context )								// nesting ?
+#define context `context`
+#define __CFA_EXPAT2_H__
+#endif // ! context
+
+#include_next <expat.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_EXPAT1_H__ )		// reset only if set
+#undef type
+#undef __CFA_EXPAT1_H__
+#endif // type && __CFA_EXPAT1_H__
+
+#if defined( context ) && defined( __CFA_EXPAT2_H__ )	// reset only if set
+#undef context
+#undef __CFA_EXPAT2_H__
+#endif // context && __CFA_EXPAT2_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/fcntl.h
===================================================================
--- src/libcfa/fcntl.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/fcntl.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fcntl.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 23:03:14 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:38:39 2015
+// Update Count     : 14
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_FCNTL_H__
+#endif // ! type
+
+#include_next <fcntl.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_FCNTL_H__ )		// reset only if set
+#undef type
+#undef __CFA_FCNTL_H__
+#endif // type && __CFA_FCNTL_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/form.h
===================================================================
--- src/libcfa/form.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/form.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// form.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 11:23:56 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:59:46 2015
+// Update Count     : 2
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_FORM_H__
+#endif // ! type
+
+#include_next <form.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_FORM_H__ )		// reset only if set
+#undef type
+#undef __CFA_FORM_H__
+#endif // type && __CFA_FORM_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/fstream
===================================================================
--- src/libcfa/fstream	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/fstream	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,48 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fstream -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jan 27 23:47:41 2016
+// Update Count     : 3
+//
+
+#ifndef __FSTREAM_H__
+#define __FSTREAM_H__
+
+#include "iostream"
+
+typedef struct ofstream ofstream;
+
+// implement context ostream
+ofstream *write( ofstream *, const char *, streamsize_type );
+int fail( ofstream * );
+
+ofstream *ofstream_stdout();
+ofstream *ofstream_stderr();
+ofstream *ofstream_fromfile( const char *name );
+void ofstream_close( ofstream *os );
+
+typedef struct ifstream ifstream;
+
+// implement context istream
+ifstream *read( ifstream *, char *, streamsize_type );
+ifstream *unread( ifstream *, char );
+int fail( ifstream * );
+int eof( ifstream * );
+
+ifstream *ifstream_stdin();
+ifstream *ifstream_fromfile( const char *name );
+
+#endif // __FSTREAM_H__
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/fstream.c
===================================================================
--- src/libcfa/fstream.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/fstream.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,127 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fstream.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Jan 26 17:12:59 2016
+// Update Count     : 6
+//
+
+#include "fstream"
+
+extern "C" {
+#include <stdio.h>
+#include <stdlib.h>
+}
+
+struct ofstream {
+	FILE *file;
+	int fail;
+};
+
+ofstream *write( ofstream *os, const char *data, streamsize_type size ) {
+	if ( ! os->fail ) {
+		fwrite( data, size, 1, os->file );
+		os->fail = ferror( os->file );
+	} // if
+	return os;
+} // write
+
+int fail( ofstream *os ) {
+	return os->fail;
+} // fail
+
+static ofstream *make_ofstream() {
+	ofstream *new_stream = malloc( sizeof( ofstream ) );
+	new_stream->fail = 0;
+	return new_stream;
+} // make_ofstream
+
+ofstream *ofstream_stdout() {
+	ofstream *stdout_stream = make_ofstream();
+	stdout_stream->file = stdout;
+	return stdout_stream;
+} // ofstream_stdout
+
+ofstream *ofstream_stderr() {
+	ofstream *stderr_stream = make_ofstream();
+	stderr_stream->file = stderr;
+	return stderr_stream;
+} // ofstream_stderr
+
+ofstream *ofstream_fromfile( const char *name ) {
+	ofstream *file_stream = make_ofstream();
+	file_stream->file = fopen( name, "w" );
+	file_stream->fail = file_stream->file == 0;
+	return file_stream;
+}
+
+void ofstream_close( ofstream *os ) {
+	if ( os->file != stdout && os->file != stderr ) {
+		os->fail = fclose( os->file );
+	}
+	free( os );
+}
+
+struct ifstream {
+	FILE *file;
+	int fail;
+	int eof;
+};
+
+ifstream *read( ifstream *is, char *data, streamsize_type size ) {
+	if ( ! is->fail && ! is->eof ) {
+		fread( data, size, 1, is->file );
+		is->fail = ferror( is->file );
+		is->eof = feof( is->file );
+	}
+	return is;
+}
+  
+ifstream *unread( ifstream *is, char c ) {
+	if ( ! is->fail ) {
+		if ( ! EOF == ungetc( c, is->file ) ) {
+			is->fail = 1;
+		}
+	}
+	return is;
+}
+
+int fail( ifstream *is ) {
+	return is->fail;
+}
+
+int eof( ifstream *is ) {
+	return is->eof;
+}
+
+static ifstream *make_ifstream() {
+	ifstream *new_stream = malloc( sizeof( ifstream ) );
+	new_stream->fail = 0;
+	new_stream->eof = 0;
+	return new_stream;
+}
+
+ifstream *ifstream_stdin() {
+	ifstream *stdin_stream = make_ifstream();
+	stdin_stream->file = stdin;
+	return stdin_stream;
+}
+
+ifstream *ifstream_fromfile( const char *name ) {
+	ifstream *file_stream = make_ifstream();
+	file_stream->file = fopen( name, "r" );
+	file_stream->fail = file_stream->file == 0;
+	return file_stream;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa fstream.c" //
+// End: //
Index: src/libcfa/gcrypt.h
===================================================================
--- src/libcfa/gcrypt.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/gcrypt.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// gcrypt.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Sun Jun 28 11:36:26 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 09:01:25 2015
+// Update Count     : 8
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_GCRYPT_H__
+#endif // ! type
+
+#include_next <gcrypt.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_GCRYPT_H__ )		// reset only if set
+#undef type
+#undef __CFA_GCRYPT_H__
+#endif // type && __CFA_GCRYPT_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/libcfa/iostream
===================================================================
--- src/libcfa/iostream	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/iostream	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,88 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// iostream -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jan 29 15:50:36 2016
+// Update Count     : 29
+//
+
+#ifndef IOSTREAM_H
+#define IOSTREAM_H
+
+#include "iterator"
+
+typedef unsigned long streamsize_type;
+
+context ostream( dtype ostype ) {
+	ostype *write( ostype *, const char *, streamsize_type );
+	int fail( ostype * );
+};
+
+context writeable( type T ) {
+	forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T );
+};
+
+// implement writable for some intrinsic types
+
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, int );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned int );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long int );
+forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, long long int );
+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 * endl( ostype * );
+
+// writes the range [begin, end) to the given stream
+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 );
+
+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 );
+
+//******************************************************************************
+
+context istream( dtype istype ) {
+	istype *read( istype *, char *, streamsize_type );
+	istype *unread( istype *, char );
+	int fail( istype * );
+	int eof( istype * );
+};
+
+context readable( type T ) {
+	forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, T );
+};
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype *, char * );
+
+forall( dtype istype | istream( istype ) )
+istype * ?|?( istype *, int * );
+
+#endif // IOSTREAM_H
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/iostream.c
===================================================================
--- src/libcfa/iostream.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/iostream.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,174 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// iostream.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jan 29 15:38:34 2016
+// Update Count     : 47
+//
+
+#include "iostream"
+
+extern "C" {
+#include <stdio.h>
+#include <string.h>										// strlen
+#include <complex.h>									// creal, cimag
+}
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, char c ) {
+	return write( os, &c, 1 );
+} // ?|?
+
+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 ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, float f ) {
+	char buffer[32];
+	return write( os, buffer, sprintf( buffer, "%g", f ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, double d ) {
+	char buffer[32];
+	return write( os, buffer, sprintf( buffer, "%g", d ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long double d ) {
+	char buffer[32];
+	return write( os, buffer, sprintf( buffer, "%Lg", d ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, float _Complex c ) {
+	char buffer[64];
+	return write( os, buffer, sprintf( buffer, "%g+i%g", crealf( c ), cimagf( c ) ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, double _Complex c ) {
+	char buffer[64];
+	return write( os, buffer, sprintf( buffer, "%g+i%g", creal( c ), cimag( c ) ) );
+} // ?|?
+
+forall( dtype ostype | ostream( ostype ) )
+ostype * ?|?( ostype *os, long double _Complex c ) {
+	char buffer[64];
+	return write( os, buffer, sprintf( buffer, "%Lg+i%Lg", creall( c ), cimagl( c ) ) );
+} // ?|?
+
+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);
+}
+
+forall( dtype ostype | ostream( ostype ) ) 
+ostype * endl( ostype * os ) {
+  os | "\n";
+  // flush
+  return os;
+} // endl
+
+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 | ' ';
+	}
+	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 | ' '; }
+	for_each_reverse( begin, end, print );
+} // ?|?
+
+
+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 ) {
+	char cur;
+  
+	// skip some whitespace
+	do {
+		is | &cur;
+		if ( fail( is ) || eof( is ) ) return is;
+	} while ( !( cur >= '0' && cur <= '9' ) );
+  
+	// accumulate digits
+	*ip = 0;
+	while ( cur >= '0' && cur <= '9' ) {
+		*ip = *ip * 10 + ( cur - '0' );
+		is | &cur;
+		if ( fail( is ) || eof( is ) ) return is;
+	}
+  
+	unread( is, cur );
+	return is;
+} // ?|?
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa iostream.c" //
+// End: //
Index: src/libcfa/iterator
===================================================================
--- src/libcfa/iterator	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/iterator	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,51 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// iterator -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jan 27 23:49:13 2016
+// Update Count     : 7
+//
+
+#ifndef ITERATOR_H
+#define ITERATOR_H
+
+// An iterator can be used to traverse a data structure.
+context iterator( type iterator_type, type elt_type ) {
+	// point to the next element
+//	iterator_type ?++( iterator_type * );
+	iterator_type ++?( iterator_type * );
+	iterator_type --?( iterator_type * );
+
+	// can be tested for equality with other iterators
+	int ?==?( iterator_type, iterator_type );
+	int ?!=?( iterator_type, iterator_type );
+
+	// dereference to get the pointed-at element
+	lvalue elt_type *?( iterator_type );
+};
+
+context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
+//	[ iterator_type begin, iterator_type end ] get_iterators( collection_type );
+	iterator_type begin( collection_type );
+	iterator_type end( collection_type );
+};
+
+forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
+void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
+
+forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
+void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
+
+#endif // ITERATOR_H
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/iterator.c
===================================================================
--- src/libcfa/iterator.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/iterator.c	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,36 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// iterator.c -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Wed May 27 17:56:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Jan 26 17:16:07 2016
+// Update Count     : 26
+//
+
+#include "iterator"
+
+forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
+void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
+	for ( iterator_type i = begin; i != end; ++i ) {
+		func( *i );
+	}
+}
+
+forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
+void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
+	for ( iterator_type i = end; i != begin; ) {
+		--i;
+		func( *i );
+	}
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa iterator.c" //
+// End: //
Index: src/libcfa/limits
===================================================================
--- src/libcfa/limits	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/limits	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,92 @@
+// Integral Constants
+
+const short int MIN = -32768;
+const int MIN = -2147483648;
+const long int MIN = -9223372036854775807L - 1L;
+const long long int MIN = -9223372036854775807LL - 1LL;
+
+const short int MAX = 32767;
+const unsigned short int MAX = 65535;
+const int MAX = 2147483647;
+const unsigned int MAX = 4294967295_U;
+const long int MAX = 9223372036854775807_L;
+const unsigned long int MAX = 4294967295_U;
+const long long int MAX = 9223372036854775807_LL;
+const unsigned long long int MAX = 18446744073709551615_ULL;
+
+// Floating-Point Constants
+
+const float PI = 3.141592_F;				// pi
+const float PI_2 = 1.570796_F;				// pi / 2
+const float PI_4 = 0.7853981_F;				// pi / 4
+const float _1_PI = 0.3183098_F;			// 1 / pi
+const float _2_PI = 0.6366197_F;			// 2 / pi
+const float _2_SQRT_PI = 1.128379_F;			// 2 / sqrt(pi)
+
+const double PI = 3.14159265358979323846_D;		// pi
+const double PI_2 = 1.57079632679489661923_D;		// pi / 2
+const double PI_4 = 0.78539816339744830962_D;		// pi / 4
+const double _1_PI = 0.31830988618379067154_D;		// 1 / pi
+const double _2_PI = 0.63661977236758134308_D;		// 2 / pi
+const double _2_SQRT_PI = 1.12837916709551257390_D;	// 2 / sqrt(pi)
+
+const long double PI = 3.1415926535897932384626433832795029_DL; // pi
+const long double PI_2 = 1.5707963267948966192313216916397514_DL; // pi / 2
+const long double PI_4 = 0.7853981633974483096156608458198757_DL; // pi / 4
+const long double _1_PI = 0.3183098861837906715377675267450287_DL; // 1 / pi
+const long double _2_PI = 0.6366197723675813430755350534900574_DL; // 2 / pi
+const long double _2_SQRT_PI = 1.1283791670955125738961589031215452_DL; // 2 / sqrt(pi)
+
+const _Complex PI = 3.14159265358979323846_D+0.0_iD;	// pi
+const _Complex PI_2 = 1.57079632679489661923_D+0.0_iD;	// pi / 2
+const _Complex PI_4 = 0.78539816339744830962_D+0.0_iD;	// pi / 4
+const _Complex _1_PI = 0.31830988618379067154_D+0.0_iD;	// 1 / pi
+const _Complex _2_PI = 0.63661977236758134308_D+0.0_iD;	// 2 / pi
+const _Complex _2_SQRT_PI = 1.12837916709551257390_D+0.0_iD; // 2 / sqrt(pi)
+
+const long _Complex PI = 3.1415926535897932384626433832795029_L+0.0iL; // pi
+const long _Complex PI_2 = 1.5707963267948966192313216916397514_L+0.0iL; // pi / 2
+const long _Complex PI_4 = 0.7853981633974483096156608458198757_L+0.0iL; // pi / 4
+const long _Complex _1_PI = 0.3183098861837906715377675267450287_L+0.0iL; // 1 / pi
+const long _Complex _2_PI = 0.6366197723675813430755350534900574_L+0.0iL; // 2 / pi
+const long _Complex _2_SQRT_PI = 1.1283791670955125738961589031215452_L+0.0iL; // 2 / sqrt(pi)
+
+const float E = 2.718281;				// e
+const float LOG2_E = 1.442695;				// log_2(e)
+const float LOG10_E = 0.4342944;			// log_10(e)
+const float LN_2 = 0.6931471;				// log_e(2)
+const float LN_10 = 2.302585;				// log_e(10)
+const float SQRT_2 = 1.414213;				// sqrt(2)
+const float _1_SQRT_2 = 0.7071067;			// 1 / sqrt(2)
+
+const double E = 2.7182818284590452354_D;		// e
+const double LOG2_E = 1.4426950408889634074_D;		// log_2(e)
+const double LOG10_E = 0.43429448190325182765_D;	// log_10(e)
+const double LN_2 = 0.69314718055994530942_D;		// log_e(2)
+const double LN_10 = 2.30258509299404568402_D;		// log_e(10)
+const double SQRT_2 = 1.41421356237309504880_D;		// sqrt(2)
+const double _1_SQRT_2 = 0.70710678118654752440_D;	// 1 / sqrt(2)
+
+const long double E = 2.7182818284590452353602874713526625_DL; // e
+const long double LOG2_E = 1.4426950408889634073599246810018921_DL; // log_2(e)
+const long double LOG10_E = 0.4342944819032518276511289189166051_DL; // log_10(e)
+const long double LN_2 = 0.6931471805599453094172321214581766_DL; // log_e(2)
+const long double LN_10 = 2.3025850929940456840179914546843642_DL; // log_e(10)
+const long double SQRT_2 = 1.4142135623730950488016887242096981_DL; // sqrt(2)
+const long double _1_SQRT_2 = 0.7071067811865475244008443621048490_DL; // 1/sqrt(2)
+
+const _Complex E = 2.7182818284590452354_D+0.0_iD;	// e
+const _Complex LOG2_E = 1.4426950408889634074_D+0.0_iD;	// log_2(e)
+const _Complex LOG10_E = 0.43429448190325182765_D+0.0_iD; // log_10(e)
+const _Complex LN_2 = 0.69314718055994530942_D+0.0_iD;	// log_e(2)
+const _Complex LN_10 = 2.30258509299404568402_D+0.0_iD;	// log_e(10)
+const _Complex SQRT_2 = 1.41421356237309504880_D+0.0_iD;	// sqrt(2)
+const _Complex _1_SQRT_2 = 0.70710678118654752440_D+0.0_iD; // 1 / sqrt(2)
+
+const long _Complex E = 2.7182818284590452353602874713526625_L+0.0_iL; // e
+const long _Complex LOG2_E = 1.4426950408889634073599246810018921_L+0.0_iL; // log_2(e)
+const long _Complex LOG10_E = 0.4342944819032518276511289189166051_L+0.0_iL; // log_10(e)
+const long _Complex LN_2 = 0.6931471805599453094172321214581766_L+0.0_iL; // log_e(2)
+const long _Complex LN_10 = 2.3025850929940456840179914546843642_L+0.0_iL; // log_e(10)
+const long _Complex SQRT_2 = 1.4142135623730950488016887242096981_L+0.0_iL; // sqrt(2)
+const long _Complex _1_SQRT_2 = 0.7071067811865475244008443621048490_L+0.0_iL; // 1 / sqrt(2)
Index: src/libcfa/math.h
===================================================================
--- src/libcfa/math.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
+++ src/libcfa/math.h	(revision d3b7937ae7ab8afece0824b5729b7e86a9f0bd63)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// math.h -- 
+//
+// Author           : Peter A. Buhr
+// Created On       : Mon Nov 10 23:41:29 2014
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Dec 21 08:37:57 2015
+// Update Count     : 12
+
+// This include file uses the CFA keyword "type" as a field name of a structure.
+
+#if ! defined( type )									// nesting ?
+#define type `type`
+#define __CFA_MATH_H__
+#endif // ! type
+
+#include_next <math.h>									// has internal check for multiple expansion
+
+#if defined( type ) && defined( __CFA_MATH_H__ )		// reset only if set
+#undef type
+#undef __CFA_MATH_H__
+#endif // type && __CFA_MATH_H__
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
