Index: src/hu/varadiistvan/scpl/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/.copyright	(revision 1)
+++ src/hu/varadiistvan/scpl/.copyright	(revision 1)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/.copyright	(revision 1)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/.namespace	(revision 1)
+++ src/hu/varadiistvan/scpl/.namespace	(revision 1)
@@ -0,0 +1,3 @@
+hu
+varadiistvan
+scpl
Index: src/hu/varadiistvan/scpl/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/.namespace	(revision 1)
+++ 	(revision )
@@ -1,3 +1,0 @@
-hu
-varadiistvan
-scpl
Index: src/hu/varadiistvan/scpl/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/.srcmessage	(revision 1)
+++ src/hu/varadiistvan/scpl/.srcmessage	(revision 1)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/.srcmessage	(revision 1)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/CondVar.h	(revision 6)
+++ src/hu/varadiistvan/scpl/CondVar.h	(revision 6)
@@ -0,0 +1,113 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_CONDVAR_H
+#define HU_VARADIISTVAN_SCPL_CONDVAR_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of CondVar
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+class Mutex;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Condition variable.
+ */
+class CondVar
+{
+public:
+    /**
+     * Wait for the condition variable.
+     *
+     * @param mutex the mutex to unlock and re-lock.
+     * @param timeout the number of milliseconds to wait at most. If
+     * negative, the function will wait indefinitely.
+     *
+     * @return true, if the condition variable was signalled, false
+     * if a timeout occured
+     */
+    bool wait(Mutex& mutex, int timeout = -1);
+
+    /**
+     * Signal the condition variable to wake up one thread.
+     */
+    void signal();
+
+    /**
+     * Signal all threads waiting on the condition variable.
+     */
+    void broadcast();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of CondVar
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/CondVar.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/CondVar.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_CONDVAR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/CondVar.h	(revision 6)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_CONDVAR_H
-#define HU_VARADIISTVAN_SCPL_CONDVAR_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of CondVar
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-class Mutex;
-
-//------------------------------------------------------------------------------
-
-/**
- * Condition variable.
- */
-class CondVar
-{
-public:
-    /**
-     * Wait for the condition variable.
-     *
-     * @param mutex the mutex to unlock and re-lock.
-     * @param timeout the number of milliseconds to wait at most. If
-     * negative, the function will wait indefinitely.
-     *
-     * @return true, if the condition variable was signalled, false
-     * if a timeout occured
-     */
-    bool wait(Mutex& mutex, int timeout = -1);
-
-    /**
-     * Signal the condition variable to wake up one thread.
-     */
-    void signal();
-
-    /**
-     * Signal all threads waiting on the condition variable.
-     */
-    void broadcast();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of CondVar
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/CondVar.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/CondVar.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_CONDVAR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/Makefile.am	(revision 21)
+++ src/hu/varadiistvan/scpl/Makefile.am	(revision 21)
@@ -0,0 +1,37 @@
+SUBDIRS=io
+
+if TARGET_API_POSIX
+SUBDIRS+=_posix
+AM_LDFLAGS=-lpthread
+endif
+
+if TARGET_API_WIN32
+SUBDIRS+=_win32
+AM_LDFLAGS=-no-undefined
+endif
+
+lib_LTLIBRARIES=libvscpl.la
+
+libvscpl_la_SOURCES=\
+        PseudoRandom.cc
+
+libvscpl_la_LIBADD=
+
+if TARGET_API_POSIX
+libvscpl_la_LIBADD+=_posix/libvscpl_posix.la
+endif
+
+if TARGET_API_WIN32
+libvscpl_la_LIBADD+=_win32/libvscpl_win32.la
+endif
+
+libvscpl_la_LIBADD+=io/libvscpl_io.la
+
+include_vscpldir=$(includedir)/hu/varadiistvan/scpl
+include_vscpl_HEADERS=\
+        types.h                 \
+        Thread.h                \
+        Mutex.h                 \
+        CondVar.h               \
+        PseudoRandom.h
+nodist_include_vscpl_HEADERS=config.h
Index: src/hu/varadiistvan/scpl/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/Makefile.am	(revision 21)
+++ 	(revision )
@@ -1,37 +1,0 @@
-SUBDIRS=io
-
-if TARGET_API_POSIX
-SUBDIRS+=_posix
-AM_LDFLAGS=-lpthread
-endif
-
-if TARGET_API_WIN32
-SUBDIRS+=_win32
-AM_LDFLAGS=-no-undefined
-endif
-
-lib_LTLIBRARIES=libvscpl.la
-
-libvscpl_la_SOURCES=\
-        PseudoRandom.cc
-
-libvscpl_la_LIBADD=
-
-if TARGET_API_POSIX
-libvscpl_la_LIBADD+=_posix/libvscpl_posix.la
-endif
-
-if TARGET_API_WIN32
-libvscpl_la_LIBADD+=_win32/libvscpl_win32.la
-endif
-
-libvscpl_la_LIBADD+=io/libvscpl_io.la
-
-include_vscpldir=$(includedir)/hu/varadiistvan/scpl
-include_vscpl_HEADERS=\
-        types.h                 \
-        Thread.h                \
-        Mutex.h                 \
-        CondVar.h               \
-        PseudoRandom.h
-nodist_include_vscpl_HEADERS=config.h
Index: src/hu/varadiistvan/scpl/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/Mutex.h	(revision 6)
+++ src/hu/varadiistvan/scpl/Mutex.h	(revision 6)
@@ -0,0 +1,105 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_MUTEX_H
+#define HU_VARADIISTVAN_SCPL_MUTEX_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of Mutex
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A mutual exclusion device.
+ */
+class Mutex
+{
+public:
+    /**
+     * Lock the mutex. If the mutex is locked by another thread, the
+     * caller one waits until the other thread releases the mutex.
+     */
+    void lock();
+
+    /**
+     * Try to lock the mutex. If the mutex is locked by another
+     * thread, this function returns false immediately. Otherwise it
+     * locks the mutex and returns true.
+     */
+    bool tryLock();
+
+    /**
+     * Unlock the mutex.
+     */
+    void unlock();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of Mutex
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/Mutex.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/Mutex.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_MUTEX_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/Mutex.h	(revision 6)
+++ 	(revision )
@@ -1,105 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_MUTEX_H
-#define HU_VARADIISTVAN_SCPL_MUTEX_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of Mutex
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A mutual exclusion device.
- */
-class Mutex
-{
-public:
-    /**
-     * Lock the mutex. If the mutex is locked by another thread, the
-     * caller one waits until the other thread releases the mutex.
-     */
-    void lock();
-
-    /**
-     * Try to lock the mutex. If the mutex is locked by another
-     * thread, this function returns false immediately. Otherwise it
-     * locks the mutex and returns true.
-     */
-    bool tryLock();
-
-    /**
-     * Unlock the mutex.
-     */
-    void unlock();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of Mutex
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/Mutex.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/Mutex.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_MUTEX_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/PseudoRandom.cc
===================================================================
--- src/hu/varadiistvan/scpl/PseudoRandom.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/PseudoRandom.cc	(revision 8)
@@ -0,0 +1,65 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "PseudoRandom.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::PseudoRandom;
+
+//------------------------------------------------------------------------------
+
+void PseudoRandom::initialize(uint32_t seed)
+{
+    vector[0] = seed;
+    for(size_t i = 1; i<vectorSize-3; ++i) {
+        int32_t x = (static_cast<long long>(16807) *
+                     static_cast<long long>(vector[i-1])) % 2147483647;
+        if (x<0) x += 2147483647;
+        vector[i] = x;
+    }
+    for(size_t i = vectorSize - 3; i<vectorSize; ++i) {
+        vector[i] = vector[i-31];
+    }
+
+    nextIndex = 0;
+
+    for(size_t i = vectorSize; i<numDiscarded; ++i) {
+        next();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/PseudoRandom.cc
===================================================================
--- src/hu/varadiistvan/scpl/PseudoRandom.cc	(revision 8)
+++ 	(revision )
@@ -1,65 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "PseudoRandom.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::PseudoRandom;
-
-//------------------------------------------------------------------------------
-
-void PseudoRandom::initialize(uint32_t seed)
-{
-    vector[0] = seed;
-    for(size_t i = 1; i<vectorSize-3; ++i) {
-        int32_t x = (static_cast<long long>(16807) *
-                     static_cast<long long>(vector[i-1])) % 2147483647;
-        if (x<0) x += 2147483647;
-        vector[i] = x;
-    }
-    for(size_t i = vectorSize - 3; i<vectorSize; ++i) {
-        vector[i] = vector[i-31];
-    }
-
-    nextIndex = 0;
-
-    for(size_t i = vectorSize; i<numDiscarded; ++i) {
-        next();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/PseudoRandom.h
===================================================================
--- src/hu/varadiistvan/scpl/PseudoRandom.h	(revision 8)
+++ src/hu/varadiistvan/scpl/PseudoRandom.h	(revision 8)
@@ -0,0 +1,174 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
+#define HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
+//------------------------------------------------------------------------------
+
+#include <cstdlib>
+#include <ctime>
+
+#include <inttypes.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A pseudo-random number generator. The algorithm is the same as
+ * described in http://www.mathstat.dal.ca/~selinger/random, i.e. the
+ * GNU libc random number generator. It is reimplemented, because
+ * Windows does not provide a thread-safe, reentrable pseudo-random
+ * number generation facility, so it should have been implemented for
+ * Win32 anyway.
+ */
+class PseudoRandom
+{
+public:
+    /**
+     * The largest random number generated in the unconverted
+     * sequence.
+     */
+    static const uint32_t MAX = (1<<31);
+
+private:
+    /**
+     * The size of the vector.
+     */
+    static const size_t vectorSize = 34;
+
+    /**
+     * The number of random numbers thrown away.
+     */
+    static const size_t numDiscarded = 344;
+
+    /**
+     * The vector of random numbers used to generate the next one.
+     */
+    uint32_t vector[vectorSize];
+
+    /**
+     * The index of the next random number.
+     */
+    int nextIndex;
+
+public:
+    /**
+     * Construct the random number generator with a default seed
+     * (taken by calling time()).
+     */
+    PseudoRandom();
+
+    /**
+     * Construct the random number generator with the given seed.
+     */
+    PseudoRandom(uint32_t seed);
+
+    /**
+     * Get the next raw value.
+     */
+    uint32_t next();
+
+    /**
+     * Get the next random number as an unsigned value between [from, to].
+     */
+    unsigned nextUnsigned(unsigned to = MAX, unsigned from=0);
+
+    /**
+     * Get the next random number as a double value between [from,
+     * to].
+     */
+    double nextDouble(double to = 1.0, double from= 0.0);
+
+private:
+    /**
+     * Initialize the random number generator with the given seed.
+     */
+    void initialize(uint32_t seed);
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline PseudoRandom::PseudoRandom()
+{
+    initialize(time(0));
+}
+
+//------------------------------------------------------------------------------
+
+inline PseudoRandom::PseudoRandom(uint32_t seed)
+{
+    initialize(seed);
+}
+
+//------------------------------------------------------------------------------
+
+inline uint32_t PseudoRandom::next()
+{
+    int i1 = (nextIndex<3) ? (vectorSize + nextIndex - 3) : (nextIndex - 3);
+    int i2 = (nextIndex<31) ? (vectorSize + nextIndex - 31) : (nextIndex - 31);
+
+    vector[nextIndex] = vector[i1] + vector[i2];
+    uint32_t x = vector[nextIndex]>>1;
+
+    ++nextIndex; if (nextIndex>=static_cast<int>(vectorSize)) nextIndex = 0;
+
+    return x;
+}
+
+//------------------------------------------------------------------------------
+
+inline unsigned PseudoRandom::nextUnsigned(unsigned to, unsigned from)
+{
+    return from + static_cast<unsigned>(static_cast<double>(to - from) * next()
+                                        / static_cast<double>(MAX));
+}
+
+//------------------------------------------------------------------------------
+
+inline double PseudoRandom::nextDouble(double to, double from)
+{
+    return from + (to-from) * next() / static_cast<double>(MAX);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/PseudoRandom.h
===================================================================
--- src/hu/varadiistvan/scpl/PseudoRandom.h	(revision 8)
+++ 	(revision )
@@ -1,174 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
-#define HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
-//------------------------------------------------------------------------------
-
-#include <cstdlib>
-#include <ctime>
-
-#include <inttypes.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A pseudo-random number generator. The algorithm is the same as
- * described in http://www.mathstat.dal.ca/~selinger/random, i.e. the
- * GNU libc random number generator. It is reimplemented, because
- * Windows does not provide a thread-safe, reentrable pseudo-random
- * number generation facility, so it should have been implemented for
- * Win32 anyway.
- */
-class PseudoRandom
-{
-public:
-    /**
-     * The largest random number generated in the unconverted
-     * sequence.
-     */
-    static const uint32_t MAX = (1<<31);
-
-private:
-    /**
-     * The size of the vector.
-     */
-    static const size_t vectorSize = 34;
-
-    /**
-     * The number of random numbers thrown away.
-     */
-    static const size_t numDiscarded = 344;
-
-    /**
-     * The vector of random numbers used to generate the next one.
-     */
-    uint32_t vector[vectorSize];
-
-    /**
-     * The index of the next random number.
-     */
-    int nextIndex;
-
-public:
-    /**
-     * Construct the random number generator with a default seed
-     * (taken by calling time()).
-     */
-    PseudoRandom();
-
-    /**
-     * Construct the random number generator with the given seed.
-     */
-    PseudoRandom(uint32_t seed);
-
-    /**
-     * Get the next raw value.
-     */
-    uint32_t next();
-
-    /**
-     * Get the next random number as an unsigned value between [from, to].
-     */
-    unsigned nextUnsigned(unsigned to = MAX, unsigned from=0);
-
-    /**
-     * Get the next random number as a double value between [from,
-     * to].
-     */
-    double nextDouble(double to = 1.0, double from= 0.0);
-
-private:
-    /**
-     * Initialize the random number generator with the given seed.
-     */
-    void initialize(uint32_t seed);
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline PseudoRandom::PseudoRandom()
-{
-    initialize(time(0));
-}
-
-//------------------------------------------------------------------------------
-
-inline PseudoRandom::PseudoRandom(uint32_t seed)
-{
-    initialize(seed);
-}
-
-//------------------------------------------------------------------------------
-
-inline uint32_t PseudoRandom::next()
-{
-    int i1 = (nextIndex<3) ? (vectorSize + nextIndex - 3) : (nextIndex - 3);
-    int i2 = (nextIndex<31) ? (vectorSize + nextIndex - 31) : (nextIndex - 31);
-
-    vector[nextIndex] = vector[i1] + vector[i2];
-    uint32_t x = vector[nextIndex]>>1;
-
-    ++nextIndex; if (nextIndex>=static_cast<int>(vectorSize)) nextIndex = 0;
-
-    return x;
-}
-
-//------------------------------------------------------------------------------
-
-inline unsigned PseudoRandom::nextUnsigned(unsigned to, unsigned from)
-{
-    return from + static_cast<unsigned>(static_cast<double>(to - from) * next()
-                                        / static_cast<double>(MAX));
-}
-
-//------------------------------------------------------------------------------
-
-inline double PseudoRandom::nextDouble(double to, double from)
-{
-    return from + (to-from) * next() / static_cast<double>(MAX);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_PSEUDORANDOM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/Thread.h	(revision 6)
+++ src/hu/varadiistvan/scpl/Thread.h	(revision 6)
@@ -0,0 +1,126 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_THREAD_H
+#define HU_VARADIISTVAN_SCPL_THREAD_H
+//------------------------------------------------------------------------------
+
+// The public interface of the Thread class common to all platforms
+#if 0
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A thread
+ */
+class Thread
+{
+public:
+    /**
+     * Sleep for the given number of milliseconds.
+     */
+    static void sleep(unsigned millis);
+
+public:
+    /**
+     * Construct the thread.
+     *
+     * @param detached if true, the thread will be created as a
+     * detached one, i.e. it can't be joined later on. The thread
+     * object will also be deleted when its run() function has
+     * finished.
+     */
+    Thread(bool detached = false);
+
+    /**
+     * Virtual destructor.
+     */
+    virtual ~Thread();
+
+    /**
+     * Start the thread.
+     *
+     * @return if the thread could be started
+     */
+    bool start();
+
+    /**
+     * Perform the thread's real operation. To be implemented in children
+     */
+    virtual void run() = 0;
+
+    /**
+     * Wait for the thread to quit.
+     */
+    void join();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of the Thread class common to all platforms
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/Thread.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/Thread.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_THREAD_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/Thread.h	(revision 6)
+++ 	(revision )
@@ -1,126 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_THREAD_H
-#define HU_VARADIISTVAN_SCPL_THREAD_H
-//------------------------------------------------------------------------------
-
-// The public interface of the Thread class common to all platforms
-#if 0
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A thread
- */
-class Thread
-{
-public:
-    /**
-     * Sleep for the given number of milliseconds.
-     */
-    static void sleep(unsigned millis);
-
-public:
-    /**
-     * Construct the thread.
-     *
-     * @param detached if true, the thread will be created as a
-     * detached one, i.e. it can't be joined later on. The thread
-     * object will also be deleted when its run() function has
-     * finished.
-     */
-    Thread(bool detached = false);
-
-    /**
-     * Virtual destructor.
-     */
-    virtual ~Thread();
-
-    /**
-     * Start the thread.
-     *
-     * @return if the thread could be started
-     */
-    bool start();
-
-    /**
-     * Perform the thread's real operation. To be implemented in children
-     */
-    virtual void run() = 0;
-
-    /**
-     * Wait for the thread to quit.
-     */
-    void join();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of the Thread class common to all platforms
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/Thread.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/Thread.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_THREAD_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_posix/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.copyright	(revision 1)
+++ src/hu/varadiistvan/scpl/_posix/.copyright	(revision 1)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/_posix/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.copyright	(revision 1)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/_posix/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.namespace	(revision 1)
+++ src/hu/varadiistvan/scpl/_posix/.namespace	(revision 1)
@@ -0,0 +1,3 @@
+hu
+varadiistvan
+scpl
Index: src/hu/varadiistvan/scpl/_posix/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.namespace	(revision 1)
+++ 	(revision )
@@ -1,3 +1,0 @@
-hu
-varadiistvan
-scpl
Index: src/hu/varadiistvan/scpl/_posix/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.srcmessage	(revision 1)
+++ src/hu/varadiistvan/scpl/_posix/.srcmessage	(revision 1)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/_posix/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/_posix/.srcmessage	(revision 1)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/_posix/CondVar.cc
===================================================================
--- src/hu/varadiistvan/scpl/_posix/CondVar.cc	(revision 5)
+++ src/hu/varadiistvan/scpl/_posix/CondVar.cc	(revision 5)
@@ -0,0 +1,60 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "CondVar.h"
+
+#include <sys/time.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::CondVar;
+
+//------------------------------------------------------------------------------
+
+void CondVar::getAbsTime(struct ::timespec& abstime, int timeout)
+{
+    struct timeval tv;
+    gettimeofday(&tv, 0);
+
+    abstime.tv_sec = tv.tv_sec + timeout / 1000;
+    abstime.tv_nsec = (tv.tv_usec + (timeout%1000) * 1000) * 1000;
+    if (abstime.tv_nsec>=1000000000) {
+        ++abstime.tv_sec;
+        abstime.tv_nsec -= 1000000000;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_posix/CondVar.cc
===================================================================
--- src/hu/varadiistvan/scpl/_posix/CondVar.cc	(revision 5)
+++ 	(revision )
@@ -1,60 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "CondVar.h"
-
-#include <sys/time.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::CondVar;
-
-//------------------------------------------------------------------------------
-
-void CondVar::getAbsTime(struct ::timespec& abstime, int timeout)
-{
-    struct timeval tv;
-    gettimeofday(&tv, 0);
-
-    abstime.tv_sec = tv.tv_sec + timeout / 1000;
-    abstime.tv_nsec = (tv.tv_usec + (timeout%1000) * 1000) * 1000;
-    if (abstime.tv_nsec>=1000000000) {
-        ++abstime.tv_sec;
-        abstime.tv_nsec -= 1000000000;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_posix/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/CondVar.h	(revision 6)
+++ src/hu/varadiistvan/scpl/_posix/CondVar.h	(revision 6)
@@ -0,0 +1,147 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_POSIX_CONDVAR_H
+#define HU_VARADIISTVAN_SCPL_POSIX_CONDVAR_H
+//------------------------------------------------------------------------------
+
+#include "Mutex.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A condition variable for POSIX threads.
+ */
+class CondVar
+{
+private:
+    /**
+     * Fill the given timespec with the absolute time corresponding to
+     * the given relative timeout.
+     */
+    static void getAbsTime(struct ::timespec& abstime, int timeout);
+
+    /**
+     * The pthreads structure.
+     */
+    pthread_cond_t cond;
+
+public:
+    /**
+     * Construct the condition variable.
+     */
+    CondVar();
+
+    /**
+     * Destroy the condition variable.
+     */
+    ~CondVar();
+
+    /**
+     * Wait for the condition variable.
+     *
+     * @param mutex the mutex to unlock and re-lock.
+     * @param timeout the number of milliseconds to wait at most. If
+     * negative, the function will wait indefinitely.
+     *
+     * @return true, if the condition variable was signalled, false
+     * if a timeout occured
+     */
+    bool wait(Mutex& mutex, int timeout = -1);
+
+    /**
+     * Signal the condition variable to wake up one thread.
+     */
+    void signal();
+
+    /**
+     * Signal all threads waiting on the condition variable.
+     */
+    void broadcast();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline CondVar::CondVar()
+{
+    pthread_cond_init(&cond, 0);
+}
+
+//------------------------------------------------------------------------------
+
+inline CondVar::~CondVar()
+{
+    pthread_cond_destroy(&cond);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool CondVar::wait(Mutex& mutex, int timeout)
+{
+    if (timeout<0) {
+        pthread_cond_wait(&cond, &mutex.mutex);
+        return true;
+    } else {
+        struct ::timespec abstime;
+        getAbsTime(abstime, timeout);
+        return pthread_cond_timedwait(&cond, &mutex.mutex, &abstime)==0;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+inline void CondVar::signal()
+{
+    pthread_cond_signal(&cond);
+}
+
+//------------------------------------------------------------------------------
+
+inline void CondVar::broadcast()
+{
+    pthread_cond_broadcast(&cond);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_CONDVAR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_posix/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/CondVar.h	(revision 6)
+++ 	(revision )
@@ -1,147 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_POSIX_CONDVAR_H
-#define HU_VARADIISTVAN_SCPL_POSIX_CONDVAR_H
-//------------------------------------------------------------------------------
-
-#include "Mutex.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A condition variable for POSIX threads.
- */
-class CondVar
-{
-private:
-    /**
-     * Fill the given timespec with the absolute time corresponding to
-     * the given relative timeout.
-     */
-    static void getAbsTime(struct ::timespec& abstime, int timeout);
-
-    /**
-     * The pthreads structure.
-     */
-    pthread_cond_t cond;
-
-public:
-    /**
-     * Construct the condition variable.
-     */
-    CondVar();
-
-    /**
-     * Destroy the condition variable.
-     */
-    ~CondVar();
-
-    /**
-     * Wait for the condition variable.
-     *
-     * @param mutex the mutex to unlock and re-lock.
-     * @param timeout the number of milliseconds to wait at most. If
-     * negative, the function will wait indefinitely.
-     *
-     * @return true, if the condition variable was signalled, false
-     * if a timeout occured
-     */
-    bool wait(Mutex& mutex, int timeout = -1);
-
-    /**
-     * Signal the condition variable to wake up one thread.
-     */
-    void signal();
-
-    /**
-     * Signal all threads waiting on the condition variable.
-     */
-    void broadcast();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline CondVar::CondVar()
-{
-    pthread_cond_init(&cond, 0);
-}
-
-//------------------------------------------------------------------------------
-
-inline CondVar::~CondVar()
-{
-    pthread_cond_destroy(&cond);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool CondVar::wait(Mutex& mutex, int timeout)
-{
-    if (timeout<0) {
-        pthread_cond_wait(&cond, &mutex.mutex);
-        return true;
-    } else {
-        struct ::timespec abstime;
-        getAbsTime(abstime, timeout);
-        return pthread_cond_timedwait(&cond, &mutex.mutex, &abstime)==0;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-inline void CondVar::signal()
-{
-    pthread_cond_signal(&cond);
-}
-
-//------------------------------------------------------------------------------
-
-inline void CondVar::broadcast()
-{
-    pthread_cond_broadcast(&cond);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_CONDVAR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_posix/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Makefile.am	(revision 5)
+++ src/hu/varadiistvan/scpl/_posix/Makefile.am	(revision 5)
@@ -0,0 +1,11 @@
+noinst_LTLIBRARIES=libvscpl_posix.la
+
+libvscpl_posix_la_SOURCES =	\
+	Thread.cc		\
+	CondVar.cc
+
+include_vscpl_posixdir=$(includedir)/hu/varadiistvan/scpl/_posix
+include_vscpl_posix_HEADERS=\
+	Thread.h		\
+	Mutex.h			\
+	CondVar.h
Index: src/hu/varadiistvan/scpl/_posix/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Makefile.am	(revision 5)
+++ 	(revision )
@@ -1,11 +1,0 @@
-noinst_LTLIBRARIES=libvscpl_posix.la
-
-libvscpl_posix_la_SOURCES =	\
-	Thread.cc		\
-	CondVar.cc
-
-include_vscpl_posixdir=$(includedir)/hu/varadiistvan/scpl/_posix
-include_vscpl_posix_HEADERS=\
-	Thread.h		\
-	Mutex.h			\
-	CondVar.h
Index: src/hu/varadiistvan/scpl/_posix/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Mutex.h	(revision 6)
+++ src/hu/varadiistvan/scpl/_posix/Mutex.h	(revision 6)
@@ -0,0 +1,132 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
+#define HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
+//------------------------------------------------------------------------------
+
+#include <pthread.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Mutual exclusion device for POSIX threads.
+ */
+class Mutex
+{
+private:
+    /**
+     * The mutex structure.
+     */
+    pthread_mutex_t mutex;
+
+public:
+    /**
+     * Construct the mutex.
+     */
+    Mutex();
+
+    /**
+     * Destroy the mutex.
+     */
+    ~Mutex();
+
+    /**
+     * Lock the mutex. If the mutex is locked by another thread, the
+     * caller one waits until the other thread releases the mutex.
+     */
+    void lock();
+
+    /**
+     * Try to lock the mutex. If the mutex is locked by another
+     * thread, this function returns false immediately. Otherwise it
+     * locks the mutex and returns true.
+     */
+    bool tryLock();
+
+    /**
+     * Unlock the mutex.
+     */
+    void unlock();
+
+    friend class CondVar;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Mutex::Mutex()
+{
+    pthread_mutex_init(&mutex, 0);
+}
+
+//------------------------------------------------------------------------------
+
+inline Mutex::~Mutex()
+{
+    pthread_mutex_destroy(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline void Mutex::lock()
+{
+    pthread_mutex_lock(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Mutex::tryLock()
+{
+    return pthread_mutex_trylock(&mutex)==0;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Mutex::unlock()
+{
+    pthread_mutex_unlock(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_posix/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Mutex.h	(revision 6)
+++ 	(revision )
@@ -1,132 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
-#define HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
-//------------------------------------------------------------------------------
-
-#include <pthread.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * Mutual exclusion device for POSIX threads.
- */
-class Mutex
-{
-private:
-    /**
-     * The mutex structure.
-     */
-    pthread_mutex_t mutex;
-
-public:
-    /**
-     * Construct the mutex.
-     */
-    Mutex();
-
-    /**
-     * Destroy the mutex.
-     */
-    ~Mutex();
-
-    /**
-     * Lock the mutex. If the mutex is locked by another thread, the
-     * caller one waits until the other thread releases the mutex.
-     */
-    void lock();
-
-    /**
-     * Try to lock the mutex. If the mutex is locked by another
-     * thread, this function returns false immediately. Otherwise it
-     * locks the mutex and returns true.
-     */
-    bool tryLock();
-
-    /**
-     * Unlock the mutex.
-     */
-    void unlock();
-
-    friend class CondVar;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Mutex::Mutex()
-{
-    pthread_mutex_init(&mutex, 0);
-}
-
-//------------------------------------------------------------------------------
-
-inline Mutex::~Mutex()
-{
-    pthread_mutex_destroy(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline void Mutex::lock()
-{
-    pthread_mutex_lock(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Mutex::tryLock()
-{
-    return pthread_mutex_trylock(&mutex)==0;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Mutex::unlock()
-{
-    pthread_mutex_unlock(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_POSIX_MUTEX_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_posix/Thread.cc
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Thread.cc	(revision 1)
+++ src/hu/varadiistvan/scpl/_posix/Thread.cc	(revision 1)
@@ -0,0 +1,66 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Thread.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::Thread;
+
+//------------------------------------------------------------------------------
+
+void* Thread::threadFn(void* arg)
+{
+    Thread* thread = reinterpret_cast<Thread*>(arg);
+    thread->run();
+    if (thread->detached) delete thread;
+    return 0;
+}
+
+//------------------------------------------------------------------------------
+
+bool Thread::start()
+{
+    pthread_attr_t attr;
+    pthread_attr_init(&attr);
+    pthread_attr_setdetachstate(&attr, detached ? PTHREAD_CREATE_DETACHED :
+                                PTHREAD_CREATE_JOINABLE);
+    bool isOK = pthread_create(&thread, &attr, &threadFn, this)>=0;
+    pthread_attr_destroy(&attr);
+    return isOK;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_posix/Thread.cc
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Thread.cc	(revision 1)
+++ 	(revision )
@@ -1,66 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Thread.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::Thread;
-
-//------------------------------------------------------------------------------
-
-void* Thread::threadFn(void* arg)
-{
-    Thread* thread = reinterpret_cast<Thread*>(arg);
-    thread->run();
-    if (thread->detached) delete thread;
-    return 0;
-}
-
-//------------------------------------------------------------------------------
-
-bool Thread::start()
-{
-    pthread_attr_t attr;
-    pthread_attr_init(&attr);
-    pthread_attr_setdetachstate(&attr, detached ? PTHREAD_CREATE_DETACHED :
-                                PTHREAD_CREATE_JOINABLE);
-    bool isOK = pthread_create(&thread, &attr, &threadFn, this)>=0;
-    pthread_attr_destroy(&attr);
-    return isOK;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_posix/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Thread.h	(revision 1)
+++ src/hu/varadiistvan/scpl/_posix/Thread.h	(revision 1)
@@ -0,0 +1,138 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
+#define HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
+//------------------------------------------------------------------------------
+
+#include <pthread.h>
+#include <unistd.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A pthreads-based thread implementation.
+ */
+class Thread
+{
+public:
+    /**
+     * Sleep for the given number of milliseconds.
+     */
+    static void sleep(unsigned millis);
+
+private:
+    /**
+     * The thread-runner function.
+     */
+    static void* threadFn(void* arg);
+
+    /**
+     * Indicate if the thread is detached or not.
+     */
+    bool detached;
+
+    /**
+     * The posix thread handle.
+     */
+    pthread_t thread;
+
+public:
+    /**
+     * Construct the thread
+     */
+    Thread(bool detached = false);
+
+    /**
+     * Virtual destructor.
+     */
+    virtual ~Thread();
+
+    /**
+     * Start the thread.
+     *
+     * @return if the thread could be started
+     */
+    bool start();
+
+    /**
+     * Perform the thread's real operation.
+     */
+    virtual void run() = 0;
+
+    /**
+     * Wait for the thread to quit.
+     */
+    void join();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline void Thread::sleep(unsigned millis)
+{
+    usleep(static_cast<useconds_t>(millis)*1000);
+}
+
+//------------------------------------------------------------------------------
+
+inline Thread::Thread(bool detached) :
+    detached(detached)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Thread::~Thread()
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline void Thread::join()
+{
+    pthread_join(thread, 0);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_posix/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/_posix/Thread.h	(revision 1)
+++ 	(revision )
@@ -1,138 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
-#define HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
-//------------------------------------------------------------------------------
-
-#include <pthread.h>
-#include <unistd.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A pthreads-based thread implementation.
- */
-class Thread
-{
-public:
-    /**
-     * Sleep for the given number of milliseconds.
-     */
-    static void sleep(unsigned millis);
-
-private:
-    /**
-     * The thread-runner function.
-     */
-    static void* threadFn(void* arg);
-
-    /**
-     * Indicate if the thread is detached or not.
-     */
-    bool detached;
-
-    /**
-     * The posix thread handle.
-     */
-    pthread_t thread;
-
-public:
-    /**
-     * Construct the thread
-     */
-    Thread(bool detached = false);
-
-    /**
-     * Virtual destructor.
-     */
-    virtual ~Thread();
-
-    /**
-     * Start the thread.
-     *
-     * @return if the thread could be started
-     */
-    bool start();
-
-    /**
-     * Perform the thread's real operation.
-     */
-    virtual void run() = 0;
-
-    /**
-     * Wait for the thread to quit.
-     */
-    void join();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline void Thread::sleep(unsigned millis)
-{
-    usleep(static_cast<useconds_t>(millis)*1000);
-}
-
-//------------------------------------------------------------------------------
-
-inline Thread::Thread(bool detached) :
-    detached(detached)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Thread::~Thread()
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline void Thread::join()
-{
-    pthread_join(thread, 0);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_POSIX_THREAD_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_win32/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.copyright	(revision 1)
+++ src/hu/varadiistvan/scpl/_win32/.copyright	(revision 1)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/_win32/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.copyright	(revision 1)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/_win32/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.namespace	(revision 1)
+++ src/hu/varadiistvan/scpl/_win32/.namespace	(revision 1)
@@ -0,0 +1,3 @@
+hu
+varadiistvan
+scpl
Index: src/hu/varadiistvan/scpl/_win32/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.namespace	(revision 1)
+++ 	(revision )
@@ -1,3 +1,0 @@
-hu
-varadiistvan
-scpl
Index: src/hu/varadiistvan/scpl/_win32/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.srcmessage	(revision 1)
+++ src/hu/varadiistvan/scpl/_win32/.srcmessage	(revision 1)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/_win32/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/_win32/.srcmessage	(revision 1)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/_win32/CondVar.cc
===================================================================
--- src/hu/varadiistvan/scpl/_win32/CondVar.cc	(revision 5)
+++ src/hu/varadiistvan/scpl/_win32/CondVar.cc	(revision 5)
@@ -0,0 +1,87 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "CondVar.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::CondVar;
+
+//------------------------------------------------------------------------------
+
+bool CondVar::wait(Mutex& inMutex, int timeout)
+{
+    mutex.lock();
+    ++numWaiters;
+    size_t generation = waitGeneration;
+    mutex.unlock();
+
+    inMutex.unlock();
+
+    bool lastWaiter = false;
+    bool wokenUp = false;
+    bool waitDone = false;
+    while (!waitDone) {
+        int result = WaitForSingleObject(event,
+                                         (timeout<0) ? INFINITE : timeout);
+        if (result==WAIT_OBJECT_0) {
+            mutex.lock();
+            waitDone = numToRelease>0 && generation!=waitGeneration;
+            if (waitDone) {
+                --numToRelease;
+                lastWaiter = numToRelease == 0;
+                wokenUp = true;
+            }
+            mutex.unlock();
+        } else {
+            waitDone = true;
+        }
+    }
+
+    inMutex.lock();
+
+    mutex.lock();
+    --numWaiters;
+    mutex.unlock();
+
+    if (lastWaiter) {
+        ResetEvent(event);
+    }
+
+    return wokenUp;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_win32/CondVar.cc
===================================================================
--- src/hu/varadiistvan/scpl/_win32/CondVar.cc	(revision 5)
+++ 	(revision )
@@ -1,87 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "CondVar.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::CondVar;
-
-//------------------------------------------------------------------------------
-
-bool CondVar::wait(Mutex& inMutex, int timeout)
-{
-    mutex.lock();
-    ++numWaiters;
-    size_t generation = waitGeneration;
-    mutex.unlock();
-
-    inMutex.unlock();
-
-    bool lastWaiter = false;
-    bool wokenUp = false;
-    bool waitDone = false;
-    while (!waitDone) {
-        int result = WaitForSingleObject(event,
-                                         (timeout<0) ? INFINITE : timeout);
-        if (result==WAIT_OBJECT_0) {
-            mutex.lock();
-            waitDone = numToRelease>0 && generation!=waitGeneration;
-            if (waitDone) {
-                --numToRelease;
-                lastWaiter = numToRelease == 0;
-                wokenUp = true;
-            }
-            mutex.unlock();
-        } else {
-            waitDone = true;
-        }
-    }
-
-    inMutex.lock();
-
-    mutex.lock();
-    --numWaiters;
-    mutex.unlock();
-
-    if (lastWaiter) {
-        ResetEvent(event);
-    }
-
-    return wokenUp;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_win32/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/CondVar.h	(revision 6)
+++ src/hu/varadiistvan/scpl/_win32/CondVar.h	(revision 6)
@@ -0,0 +1,168 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
+#define HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
+//------------------------------------------------------------------------------
+
+#include "Mutex.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+
+/**
+ * A condition variable for the Win32 API.
+ *
+ * Note: the CONDITION_VARIABLE structure and the associated functions
+ * are available only starting with the Windows Vista API. However,
+ * for the time being we also want to support Windows XP, hence this
+ * rather fancy implementation.
+ */
+class CondVar
+{
+private:
+    /**
+     * The mutex protecting the internal data structures.
+     */
+    Mutex mutex;
+
+    /**
+     * The number of waiters.
+     */
+    size_t numWaiters;
+
+    /**
+     * The wait generation.
+     */
+    size_t waitGeneration;
+
+    /**
+     * The number of waiters to release.
+     */
+    size_t numToRelease;
+
+    /**
+     * The event to use for waiting.
+     */
+    HANDLE event;
+
+public:
+    /**
+     * Construct the condition variable.
+     */
+    CondVar();
+
+    /**
+     * Destroy the condition variable.
+     */
+    ~CondVar();
+
+    /**
+     * Wait for the condition variable.
+     *
+     * @param mutex the mutex to unlock and re-lock.
+     * @param timeout the number of milliseconds to wait at most. If
+     * negative, the function will wait indefinitely.
+     *
+     * @return true, if the condition variable was signalled, false
+     * if a timeout occured
+     */
+    bool wait(Mutex& inMutex, int timeout = -1);
+
+    /**
+     * Signal the condition variable to wake up one thread.
+     */
+    void signal();
+
+    /**
+     * Signal all threads waiting on the condition variable.
+     */
+    void broadcast();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline CondVar::CondVar() :
+    numWaiters(0),
+    waitGeneration(0),
+    numToRelease(0)
+{
+    event  = CreateEvent(0, true, false, 0);
+}
+
+//------------------------------------------------------------------------------
+
+inline CondVar::~CondVar()
+{
+    CloseHandle(event);
+}
+
+//------------------------------------------------------------------------------
+
+inline void CondVar::signal()
+{
+    mutex.lock();
+    if (numWaiters>numToRelease) {
+        SetEvent(event);
+        ++numToRelease;
+        ++waitGeneration;
+    }
+    mutex.unlock();
+}
+
+//------------------------------------------------------------------------------
+
+inline void CondVar::broadcast()
+{
+    mutex.lock();
+    if (numWaiters>0) {
+        SetEvent(event);
+        numToRelease = numWaiters;
+        ++waitGeneration;
+    }
+    mutex.unlock();
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_win32/CondVar.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/CondVar.h	(revision 6)
+++ 	(revision )
@@ -1,168 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
-#define HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
-//------------------------------------------------------------------------------
-
-#include "Mutex.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-
-/**
- * A condition variable for the Win32 API.
- *
- * Note: the CONDITION_VARIABLE structure and the associated functions
- * are available only starting with the Windows Vista API. However,
- * for the time being we also want to support Windows XP, hence this
- * rather fancy implementation.
- */
-class CondVar
-{
-private:
-    /**
-     * The mutex protecting the internal data structures.
-     */
-    Mutex mutex;
-
-    /**
-     * The number of waiters.
-     */
-    size_t numWaiters;
-
-    /**
-     * The wait generation.
-     */
-    size_t waitGeneration;
-
-    /**
-     * The number of waiters to release.
-     */
-    size_t numToRelease;
-
-    /**
-     * The event to use for waiting.
-     */
-    HANDLE event;
-
-public:
-    /**
-     * Construct the condition variable.
-     */
-    CondVar();
-
-    /**
-     * Destroy the condition variable.
-     */
-    ~CondVar();
-
-    /**
-     * Wait for the condition variable.
-     *
-     * @param mutex the mutex to unlock and re-lock.
-     * @param timeout the number of milliseconds to wait at most. If
-     * negative, the function will wait indefinitely.
-     *
-     * @return true, if the condition variable was signalled, false
-     * if a timeout occured
-     */
-    bool wait(Mutex& inMutex, int timeout = -1);
-
-    /**
-     * Signal the condition variable to wake up one thread.
-     */
-    void signal();
-
-    /**
-     * Signal all threads waiting on the condition variable.
-     */
-    void broadcast();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline CondVar::CondVar() :
-    numWaiters(0),
-    waitGeneration(0),
-    numToRelease(0)
-{
-    event  = CreateEvent(0, true, false, 0);
-}
-
-//------------------------------------------------------------------------------
-
-inline CondVar::~CondVar()
-{
-    CloseHandle(event);
-}
-
-//------------------------------------------------------------------------------
-
-inline void CondVar::signal()
-{
-    mutex.lock();
-    if (numWaiters>numToRelease) {
-        SetEvent(event);
-        ++numToRelease;
-        ++waitGeneration;
-    }
-    mutex.unlock();
-}
-
-//------------------------------------------------------------------------------
-
-inline void CondVar::broadcast()
-{
-    mutex.lock();
-    if (numWaiters>0) {
-        SetEvent(event);
-        numToRelease = numWaiters;
-        ++waitGeneration;
-    }
-    mutex.unlock();
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WIN32_CONDVAR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_win32/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Makefile.am	(revision 13)
+++ src/hu/varadiistvan/scpl/_win32/Makefile.am	(revision 13)
@@ -0,0 +1,11 @@
+noinst_LTLIBRARIES=libvscpl_win32.la
+
+libvscpl_win32_la_SOURCES =	\
+	Thread.cc		\
+	CondVar.cc
+
+include_win32_posixdir=$(includedir)/hu/varadiistvan/scpl/_win32
+include_win32_posix_HEADERS=\
+	Thread.h		\
+	Mutex.h			\
+	CondVar.h
Index: src/hu/varadiistvan/scpl/_win32/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Makefile.am	(revision 13)
+++ 	(revision )
@@ -1,11 +1,0 @@
-noinst_LTLIBRARIES=libvscpl_win32.la
-
-libvscpl_win32_la_SOURCES =	\
-	Thread.cc		\
-	CondVar.cc
-
-include_win32_posixdir=$(includedir)/hu/varadiistvan/scpl/_win32
-include_win32_posix_HEADERS=\
-	Thread.h		\
-	Mutex.h			\
-	CondVar.h
Index: src/hu/varadiistvan/scpl/_win32/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Mutex.h	(revision 6)
+++ src/hu/varadiistvan/scpl/_win32/Mutex.h	(revision 6)
@@ -0,0 +1,132 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
+#define HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
+//------------------------------------------------------------------------------
+
+#include <windows.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Mutual exclusion device implementation for Windows.
+ */
+class Mutex
+{
+private:
+    /**
+     * The handle of the mutex.
+     */
+    CRITICAL_SECTION mutex;
+
+public:
+    /**
+     * Construct the mutex.
+     */
+    Mutex();
+
+    /**
+     * Destroy the mutex.
+     */
+    ~Mutex();
+
+    /**
+     * Lock the mutex. If the mutex is locked by another thread, the
+     * caller one waits until the other thread releases the mutex.
+     */
+    void lock();
+
+    /**
+     * Try to lock the mutex. If the mutex is locked by another
+     * thread, this function returns false immediately. Otherwise it
+     * locks the mutex and returns true.
+     */
+    bool tryLock();
+
+    /**
+     * Unlock the mutex.
+     */
+    void unlock();
+
+    friend class CondVar;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Mutex::Mutex()
+{
+    InitializeCriticalSection(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline Mutex::~Mutex()
+{
+    DeleteCriticalSection(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline void Mutex::lock()
+{
+    EnterCriticalSection(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Mutex::tryLock()
+{
+    return TryEnterCriticalSection(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+inline void Mutex::unlock()
+{
+    LeaveCriticalSection(&mutex);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_win32/Mutex.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Mutex.h	(revision 6)
+++ 	(revision )
@@ -1,132 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
-#define HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
-//------------------------------------------------------------------------------
-
-#include <windows.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * Mutual exclusion device implementation for Windows.
- */
-class Mutex
-{
-private:
-    /**
-     * The handle of the mutex.
-     */
-    CRITICAL_SECTION mutex;
-
-public:
-    /**
-     * Construct the mutex.
-     */
-    Mutex();
-
-    /**
-     * Destroy the mutex.
-     */
-    ~Mutex();
-
-    /**
-     * Lock the mutex. If the mutex is locked by another thread, the
-     * caller one waits until the other thread releases the mutex.
-     */
-    void lock();
-
-    /**
-     * Try to lock the mutex. If the mutex is locked by another
-     * thread, this function returns false immediately. Otherwise it
-     * locks the mutex and returns true.
-     */
-    bool tryLock();
-
-    /**
-     * Unlock the mutex.
-     */
-    void unlock();
-
-    friend class CondVar;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Mutex::Mutex()
-{
-    InitializeCriticalSection(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline Mutex::~Mutex()
-{
-    DeleteCriticalSection(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline void Mutex::lock()
-{
-    EnterCriticalSection(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Mutex::tryLock()
-{
-    return TryEnterCriticalSection(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-inline void Mutex::unlock()
-{
-    LeaveCriticalSection(&mutex);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WIN32_MUTEX_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_win32/Thread.cc
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Thread.cc	(revision 1)
+++ src/hu/varadiistvan/scpl/_win32/Thread.cc	(revision 1)
@@ -0,0 +1,56 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Thread.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::Thread;
+
+//------------------------------------------------------------------------------
+
+DWORD Thread::threadFn(LPVOID arg)
+{
+    Thread* thread = reinterpret_cast<Thread*>(arg);
+
+    thread->run();
+
+    if (thread->detached) delete thread;
+
+    return 0;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_win32/Thread.cc
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Thread.cc	(revision 1)
+++ 	(revision )
@@ -1,56 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Thread.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::Thread;
-
-//------------------------------------------------------------------------------
-
-DWORD Thread::threadFn(LPVOID arg)
-{
-    Thread* thread = reinterpret_cast<Thread*>(arg);
-
-    thread->run();
-
-    if (thread->detached) delete thread;
-
-    return 0;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/_win32/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Thread.h	(revision 1)
+++ src/hu/varadiistvan/scpl/_win32/Thread.h	(revision 1)
@@ -0,0 +1,156 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
+#define HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
+//------------------------------------------------------------------------------
+
+#include <windows.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A Win32 API thread implementation.
+ */
+class Thread
+{
+public:
+    /**
+     * Sleep for the given number of milliseconds.
+     */
+    static void sleep(unsigned millis);
+
+private:
+    /**
+     * The thread-runner function.
+     */
+    static DWORD WINAPI threadFn(LPVOID arg);
+
+    /**
+     * Indicate if the thread is detached.
+     */
+    bool detached;
+
+    /**
+     * The thread handle.
+     */
+    HANDLE handle;
+
+public:
+    /**
+     * Construct the thread object.
+     */
+    Thread(bool detached = false);
+
+    /**
+     * Virtual destructor.
+     */
+    virtual ~Thread();
+
+    /**
+     * Start the thread.
+     *
+     * @return if the thread could be started
+     */
+    bool start();
+
+    /**
+     * Perform the thread's real operation.
+     */
+    virtual void run() = 0;
+
+    /**
+     * Wait for the thread to quit.
+     */
+    void join();
+
+    void release();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline void Thread::sleep(unsigned millis)
+{
+    Sleep(millis);
+}
+
+//------------------------------------------------------------------------------
+
+inline Thread::Thread(bool detached) :
+    detached(detached),
+    handle(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Thread::~Thread()
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Thread::start()
+{
+    handle = CreateThread(0, 0, &threadFn, this, 0, 0);
+    bool isOK = handle!=0;
+    if (detached && handle!=0) {
+        CloseHandle(handle);
+        handle = 0;
+    }
+    return isOK;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Thread::join()
+{
+    if (handle!=0) {
+        WaitForSingleObject(handle, INFINITE);
+        CloseHandle(handle);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/_win32/Thread.h
===================================================================
--- src/hu/varadiistvan/scpl/_win32/Thread.h	(revision 1)
+++ 	(revision )
@@ -1,156 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
-#define HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
-//------------------------------------------------------------------------------
-
-#include <windows.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-/**
- * A Win32 API thread implementation.
- */
-class Thread
-{
-public:
-    /**
-     * Sleep for the given number of milliseconds.
-     */
-    static void sleep(unsigned millis);
-
-private:
-    /**
-     * The thread-runner function.
-     */
-    static DWORD WINAPI threadFn(LPVOID arg);
-
-    /**
-     * Indicate if the thread is detached.
-     */
-    bool detached;
-
-    /**
-     * The thread handle.
-     */
-    HANDLE handle;
-
-public:
-    /**
-     * Construct the thread object.
-     */
-    Thread(bool detached = false);
-
-    /**
-     * Virtual destructor.
-     */
-    virtual ~Thread();
-
-    /**
-     * Start the thread.
-     *
-     * @return if the thread could be started
-     */
-    bool start();
-
-    /**
-     * Perform the thread's real operation.
-     */
-    virtual void run() = 0;
-
-    /**
-     * Wait for the thread to quit.
-     */
-    void join();
-
-    void release();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline void Thread::sleep(unsigned millis)
-{
-    Sleep(millis);
-}
-
-//------------------------------------------------------------------------------
-
-inline Thread::Thread(bool detached) :
-    detached(detached),
-    handle(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Thread::~Thread()
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Thread::start()
-{
-    handle = CreateThread(0, 0, &threadFn, this, 0, 0);
-    bool isOK = handle!=0;
-    if (detached && handle!=0) {
-        CloseHandle(handle);
-        handle = 0;
-    }
-    return isOK;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Thread::join()
-{
-    if (handle!=0) {
-        WaitForSingleObject(handle, INFINITE);
-        CloseHandle(handle);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WIN32_THREAD_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/config.h.in
===================================================================
--- src/hu/varadiistvan/scpl/config.h.in	(revision 1)
+++ src/hu/varadiistvan/scpl/config.h.in	(revision 1)
@@ -0,0 +1,10 @@
+// Define to 1, if the library is compiled for the POSIX API
+#define TARGET_API_POSIX @TARGET_API_POSIX@
+
+// Define to 1, if the library is compiled for the 32- or 64-bit
+// Win32 API
+#define TARGET_API_WIN32 @TARGET_API_WIN32@
+
+// Define to 1, if the library is compiled for the 64-bit
+// Win32 API
+#define TARGET_API_WIN64 @TARGET_API_WIN64@
Index: src/hu/varadiistvan/scpl/config.h.in
===================================================================
--- src/hu/varadiistvan/scpl/config.h.in	(revision 1)
+++ 	(revision )
@@ -1,10 +1,0 @@
-// Define to 1, if the library is compiled for the POSIX API
-#define TARGET_API_POSIX @TARGET_API_POSIX@
-
-// Define to 1, if the library is compiled for the 32- or 64-bit
-// Win32 API
-#define TARGET_API_WIN32 @TARGET_API_WIN32@
-
-// Define to 1, if the library is compiled for the 64-bit
-// Win32 API
-#define TARGET_API_WIN64 @TARGET_API_WIN64@
Index: src/hu/varadiistvan/scpl/hgccwrapper
===================================================================
--- src/hu/varadiistvan/scpl/hgccwrapper	(revision 6)
+++ src/hu/varadiistvan/scpl/hgccwrapper	(revision 6)
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# Create a skeleton of a wrapper header for a certain class
+
+classname=$1
+uppername=`echo ${classname} | tr a-z A-Z`
+
+cat > "${classname}.h" <<EOF
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_${uppername}_H
+#define HU_VARADIISTVAN_SCPL_${uppername}_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of ${classname}
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+class ${classname}
+{
+public:
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of ${classname}
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/${classname}.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/${classname}.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_${uppername}_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
+EOF
+
+hg add "${classname}.h"
Index: src/hu/varadiistvan/scpl/hgccwrapper
===================================================================
--- src/hu/varadiistvan/scpl/hgccwrapper	(revision 6)
+++ 	(revision )
@@ -1,96 +1,0 @@
-#!/bin/sh
-
-# Create a skeleton of a wrapper header for a certain class
-
-classname=$1
-uppername=`echo ${classname} | tr a-z A-Z`
-
-cat > "${classname}.h" <<EOF
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_${uppername}_H
-#define HU_VARADIISTVAN_SCPL_${uppername}_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of ${classname}
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-class ${classname}
-{
-public:
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of ${classname}
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/${classname}.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/${classname}.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_${uppername}_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
-EOF
-
-hg add "${classname}.h"
Index: src/hu/varadiistvan/scpl/io/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/.copyright	(revision 6)
+++ src/hu/varadiistvan/scpl/io/.copyright	(revision 6)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/.copyright	(revision 6)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/.namespace	(revision 6)
+++ src/hu/varadiistvan/scpl/io/.namespace	(revision 6)
@@ -0,0 +1,4 @@
+hu
+varadiistvan
+scpl
+io
Index: src/hu/varadiistvan/scpl/io/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/.namespace	(revision 6)
+++ 	(revision )
@@ -1,4 +1,0 @@
-hu
-varadiistvan
-scpl
-io
Index: src/hu/varadiistvan/scpl/io/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/.srcmessage	(revision 6)
+++ src/hu/varadiistvan/scpl/io/.srcmessage	(revision 6)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/.srcmessage	(revision 6)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/BlockingStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/BlockingStream.cc	(revision 10)
+++ src/hu/varadiistvan/scpl/io/BlockingStream.cc	(revision 10)
@@ -0,0 +1,175 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "BlockingStream.h"
+
+#include "ReadingBuffer.h"
+#include "WritingBuffer.h"
+#include "Waiter.h"
+
+#include <cstring>
+#include <cstdio>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::BlockingStream;
+
+using std::min;
+
+//------------------------------------------------------------------------------
+
+inline bool BlockingStream::checkInterrupted()
+{
+    if (!interrupted) {
+        interrupted = event.check();
+        if (!interrupted && event.failed()) {
+            setErrorCode(event.getErrorCode());
+        }
+    }
+
+    return interrupted;
+}
+
+//------------------------------------------------------------------------------
+
+bool BlockingStream::read(void* dest, size_t length)
+{
+    unsigned char* d = reinterpret_cast<unsigned char*>(dest);
+
+    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
+    while (length>0) {
+        size_t copied = readingBuffer.extract(d, length, readingOffset);
+        readingOffset += copied;
+        length -= copied;
+        d += copied;
+
+        if (length!=0) {
+            if (!fill()) return false;
+        }
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool BlockingStream::skip(size_t length)
+{
+    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
+    while (length>0) {
+        size_t toSkip = min(length, readingBuffer.getLength() - readingOffset);
+        readingOffset += toSkip;
+        length -= toSkip;
+
+        if (length!=0) {
+            if (!fill()) return false;
+        }
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool BlockingStream::write(const void* src, size_t length)
+{
+    const unsigned char* s = reinterpret_cast<const unsigned char*>(src);
+
+    WritingBuffer& writingBuffer = stream.getWritingBuffer();
+    while(length>0) {
+        size_t copied = writingBuffer.append(s, length);
+        length -= copied;
+        s += copied;
+
+        if (length==0) break;
+        if (!flush()) return false;
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool BlockingStream::flush()
+{
+    WritingBuffer& writingBuffer = stream.getWritingBuffer();
+    while (*this) {
+        if (checkInterrupted()) return false;
+
+        if (writingBuffer.write()) {
+            return true;
+        } else if (writingBuffer.failed()) {
+            setErrorCode(writingBuffer.getErrorCode());
+        } else {
+            Waiter* waiter = stream.getWaiter();
+            waiter->wait();
+            if (waiter->failed()) {
+                setErrorCode(waiter->getErrorCode());
+            }
+        }
+    }
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+bool BlockingStream::fill()
+{
+    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
+
+    readingBuffer.reset();
+    readingOffset = 0;
+    while (*this) {
+        if (checkInterrupted()) return false;
+
+        if (readingBuffer.read()) {
+            eof = readingBuffer.isEmpty();
+            return !eof;
+        } else if (readingBuffer.failed()) {
+            setErrorCode(readingBuffer.getErrorCode());
+        } else {
+            Waiter* waiter = stream.getWaiter();
+            waiter->wait();
+            if (waiter->failed()) {
+                setErrorCode(waiter->getErrorCode());
+                return false;
+            }
+        }
+    }
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/BlockingStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/BlockingStream.cc	(revision 10)
+++ 	(revision )
@@ -1,175 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "BlockingStream.h"
-
-#include "ReadingBuffer.h"
-#include "WritingBuffer.h"
-#include "Waiter.h"
-
-#include <cstring>
-#include <cstdio>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::BlockingStream;
-
-using std::min;
-
-//------------------------------------------------------------------------------
-
-inline bool BlockingStream::checkInterrupted()
-{
-    if (!interrupted) {
-        interrupted = event.check();
-        if (!interrupted && event.failed()) {
-            setErrorCode(event.getErrorCode());
-        }
-    }
-
-    return interrupted;
-}
-
-//------------------------------------------------------------------------------
-
-bool BlockingStream::read(void* dest, size_t length)
-{
-    unsigned char* d = reinterpret_cast<unsigned char*>(dest);
-
-    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
-    while (length>0) {
-        size_t copied = readingBuffer.extract(d, length, readingOffset);
-        readingOffset += copied;
-        length -= copied;
-        d += copied;
-
-        if (length!=0) {
-            if (!fill()) return false;
-        }
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool BlockingStream::skip(size_t length)
-{
-    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
-    while (length>0) {
-        size_t toSkip = min(length, readingBuffer.getLength() - readingOffset);
-        readingOffset += toSkip;
-        length -= toSkip;
-
-        if (length!=0) {
-            if (!fill()) return false;
-        }
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool BlockingStream::write(const void* src, size_t length)
-{
-    const unsigned char* s = reinterpret_cast<const unsigned char*>(src);
-
-    WritingBuffer& writingBuffer = stream.getWritingBuffer();
-    while(length>0) {
-        size_t copied = writingBuffer.append(s, length);
-        length -= copied;
-        s += copied;
-
-        if (length==0) break;
-        if (!flush()) return false;
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool BlockingStream::flush()
-{
-    WritingBuffer& writingBuffer = stream.getWritingBuffer();
-    while (*this) {
-        if (checkInterrupted()) return false;
-
-        if (writingBuffer.write()) {
-            return true;
-        } else if (writingBuffer.failed()) {
-            setErrorCode(writingBuffer.getErrorCode());
-        } else {
-            Waiter* waiter = stream.getWaiter();
-            waiter->wait();
-            if (waiter->failed()) {
-                setErrorCode(waiter->getErrorCode());
-            }
-        }
-    }
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-bool BlockingStream::fill()
-{
-    ReadingBuffer& readingBuffer = stream.getReadingBuffer();
-
-    readingBuffer.reset();
-    readingOffset = 0;
-    while (*this) {
-        if (checkInterrupted()) return false;
-
-        if (readingBuffer.read()) {
-            eof = readingBuffer.isEmpty();
-            return !eof;
-        } else if (readingBuffer.failed()) {
-            setErrorCode(readingBuffer.getErrorCode());
-        } else {
-            Waiter* waiter = stream.getWaiter();
-            waiter->wait();
-            if (waiter->failed()) {
-                setErrorCode(waiter->getErrorCode());
-                return false;
-            }
-        }
-    }
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/BlockingStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/BlockingStream.h	(revision 10)
+++ src/hu/varadiistvan/scpl/io/BlockingStream.h	(revision 10)
@@ -0,0 +1,197 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
+#define HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
+//------------------------------------------------------------------------------
+
+#include "Failable.h"
+
+#include "BufferedStream.h"
+#include "WaitableEvent.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Wrapper for a buffered stream, which an event and provides
+ * blocking, but interruptible read() and write() operations.
+ *
+ * The class is designed in a way, that it expects its constructed
+ * instances to be called only from a single thread at a time, except
+ * for the interrupt() function, which may be called from another
+ * thread anytime.
+ */
+class BlockingStream : public Failable
+{
+private:
+    /**
+     * The buffered stream used.
+     */
+    BufferedStream& stream;
+
+    /**
+     * The waitable event.
+     */
+    WaitableEvent event;
+
+    /**
+     * Indicate if we are interrupted.
+     */
+    bool interrupted;
+
+    /**
+     * The offset in the buffer of the reading stream.
+     */
+    size_t readingOffset;
+
+    /**
+     * Indicate if the end-of-file has been reached while reading.
+     */
+    bool eof;
+
+public:
+    /**
+     * Construct the blocking stream for the given buffered stream.
+     *
+     * The stream must have a waiter which is used for waiting.
+     */
+    BlockingStream(BufferedStream& stream);
+
+    /**
+     * Determine if the stream has neither failed nor been
+     * interrupted.
+     */
+    operator bool() const;
+
+    /**
+     * Interrupt the stream. Pending or future read and write calls
+     * will return indicating error. The isInterrupted() function can
+     * be used to check if the stream was interrupted or not.
+     */
+    void interrupt();
+
+    /**
+     * Indicate if the stream is interrupted or not.
+     */
+    bool isInterrupted();
+
+    /**
+     * Read the given number of bytes into the given buffer.
+     *
+     * @return if the reading has succeeded
+     */
+    bool read(void* dest, size_t length);
+
+    /**
+     * Skip the given number of bytes.
+     */
+    bool skip(size_t length);
+
+    /**
+     * Write the given number of bytes from the given buffer. The data
+     * may not be written to the underlying stream fully, so if you
+     * want to make sure that it is sent, call flush() afterwards.
+     *
+     * @return true on success, false on error.
+     */
+    bool write(const void* src, size_t length);
+
+    /**
+     * Flush anything written so far into the buffer, but not to the
+     * underlying stream.
+     *
+     * @return whether the operation has succeeded.
+     */
+    bool flush();
+
+private:
+    /**
+     * Fill the buffer with data from the stream.
+     */
+    bool fill();
+
+    /**
+     * Check for the stream being interrupted.
+     *
+     * @return if the stream is interrupted, false otherwise
+     */
+    bool checkInterrupted();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline BlockingStream::BlockingStream(BufferedStream& stream) :
+    stream(stream),
+    event(stream.getWaiter()),
+    interrupted(false),
+    readingOffset(0),
+    eof(false)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline BlockingStream::operator bool() const
+{
+    return !failed() && !interrupted && !eof;
+}
+
+//------------------------------------------------------------------------------
+
+inline void BlockingStream::interrupt()
+{
+    event.fire();
+}
+
+//------------------------------------------------------------------------------
+
+inline bool BlockingStream::isInterrupted()
+{
+    return interrupted;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/BlockingStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/BlockingStream.h	(revision 10)
+++ 	(revision )
@@ -1,197 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
-#define HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
-//------------------------------------------------------------------------------
-
-#include "Failable.h"
-
-#include "BufferedStream.h"
-#include "WaitableEvent.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Wrapper for a buffered stream, which an event and provides
- * blocking, but interruptible read() and write() operations.
- *
- * The class is designed in a way, that it expects its constructed
- * instances to be called only from a single thread at a time, except
- * for the interrupt() function, which may be called from another
- * thread anytime.
- */
-class BlockingStream : public Failable
-{
-private:
-    /**
-     * The buffered stream used.
-     */
-    BufferedStream& stream;
-
-    /**
-     * The waitable event.
-     */
-    WaitableEvent event;
-
-    /**
-     * Indicate if we are interrupted.
-     */
-    bool interrupted;
-
-    /**
-     * The offset in the buffer of the reading stream.
-     */
-    size_t readingOffset;
-
-    /**
-     * Indicate if the end-of-file has been reached while reading.
-     */
-    bool eof;
-
-public:
-    /**
-     * Construct the blocking stream for the given buffered stream.
-     *
-     * The stream must have a waiter which is used for waiting.
-     */
-    BlockingStream(BufferedStream& stream);
-
-    /**
-     * Determine if the stream has neither failed nor been
-     * interrupted.
-     */
-    operator bool() const;
-
-    /**
-     * Interrupt the stream. Pending or future read and write calls
-     * will return indicating error. The isInterrupted() function can
-     * be used to check if the stream was interrupted or not.
-     */
-    void interrupt();
-
-    /**
-     * Indicate if the stream is interrupted or not.
-     */
-    bool isInterrupted();
-
-    /**
-     * Read the given number of bytes into the given buffer.
-     *
-     * @return if the reading has succeeded
-     */
-    bool read(void* dest, size_t length);
-
-    /**
-     * Skip the given number of bytes.
-     */
-    bool skip(size_t length);
-
-    /**
-     * Write the given number of bytes from the given buffer. The data
-     * may not be written to the underlying stream fully, so if you
-     * want to make sure that it is sent, call flush() afterwards.
-     *
-     * @return true on success, false on error.
-     */
-    bool write(const void* src, size_t length);
-
-    /**
-     * Flush anything written so far into the buffer, but not to the
-     * underlying stream.
-     *
-     * @return whether the operation has succeeded.
-     */
-    bool flush();
-
-private:
-    /**
-     * Fill the buffer with data from the stream.
-     */
-    bool fill();
-
-    /**
-     * Check for the stream being interrupted.
-     *
-     * @return if the stream is interrupted, false otherwise
-     */
-    bool checkInterrupted();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline BlockingStream::BlockingStream(BufferedStream& stream) :
-    stream(stream),
-    event(stream.getWaiter()),
-    interrupted(false),
-    readingOffset(0),
-    eof(false)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline BlockingStream::operator bool() const
-{
-    return !failed() && !interrupted && !eof;
-}
-
-//------------------------------------------------------------------------------
-
-inline void BlockingStream::interrupt()
-{
-    event.fire();
-}
-
-//------------------------------------------------------------------------------
-
-inline bool BlockingStream::isInterrupted()
-{
-    return interrupted;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_BLOCKINGSTREAM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/Buffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Buffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/Buffer.h	(revision 6)
@@ -0,0 +1,241 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_BUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_BUFFER_H
+//------------------------------------------------------------------------------
+
+#include <algorithm>
+
+#include <cstdlib>
+#include <cstring>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for buffers. It maintains a memory area of a certain
+ * capacity and the length of the data in the buffer.
+ */
+class Buffer
+{
+private:
+    /**
+     * The data itself.
+     */
+    unsigned char* data;
+
+    /**
+     * The capacity of the buffer.
+     */
+    size_t capacity;
+
+    /**
+     * The amount of data in the buffer.
+     */
+    size_t length;
+
+public:
+    /**
+     * Construct the buffer with the given capacity.
+     */
+    Buffer(size_t capacity);
+
+    /**
+     * Destroy the buffer.
+     */
+    ~Buffer();
+
+    /**
+     * Get the capacity of the buffer.
+     */
+    size_t getCapacity() const;
+
+    /**
+     * Get the pointer to the data.
+     */
+    const unsigned char* getData() const;
+
+    /**
+     * Get the pointer to the data for modification.
+     */
+    unsigned char* getData();
+
+    /**
+     * Get the length of the data.
+     */
+    size_t getLength() const;
+
+    /**
+     * Get whether the buffer is empty or not.
+     */
+    bool isEmpty() const;
+
+    /**
+     * Get the available capacity in the buffer.
+     */
+    size_t getAvailable() const;
+
+    /**
+     * Reset the buffer.
+     */
+    void reset();
+
+    /**
+     * Add the given amount to the length. Should not exceed the
+     * capacity!
+     *
+     * @return the actual amount added.
+     */
+    size_t addLength(size_t n);
+
+    /**
+     * Append the given data to the contents of the given buffer.
+     *
+     * @return the number of bytes actually appended
+     */
+    size_t append(const void* src, size_t size);
+
+    /**
+     * Extract data into the given buffer from the given offset.
+     *
+     * @return the number of bytes actually extracted.
+     */
+    size_t extract(void* dest, size_t size, size_t offset = 0) const;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Buffer::Buffer(size_t capacity) :
+    data(new unsigned char[capacity]),
+    capacity(capacity),
+    length(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Buffer::~Buffer()
+{
+    delete[] data;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::getCapacity() const
+{
+    return capacity;
+}
+
+//------------------------------------------------------------------------------
+
+inline const unsigned char* Buffer::getData() const
+{
+    return data;
+}
+
+//------------------------------------------------------------------------------
+
+inline unsigned char* Buffer::getData()
+{
+    return data;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::getLength() const
+{
+    return length;
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Buffer::isEmpty() const
+{
+    return length==0;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::getAvailable() const
+{
+    return capacity - length;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Buffer::reset()
+{
+    length = 0;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::addLength(size_t n)
+{
+    size_t toAdd = std::min(n, getAvailable());
+    length += toAdd;
+    return toAdd;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::append(const void* src, size_t size)
+{
+    size_t toCopy = std::min(size, getAvailable());
+    memcpy(data + length, src, toCopy);
+    length += toCopy;
+    return toCopy;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Buffer::extract(void* dest, size_t size, size_t offset) const
+{
+    size_t toCopy = (offset>=length) ? 0 : std::min(size, length - offset);
+    memcpy(dest, data + offset, toCopy);
+    return toCopy;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_BUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/Buffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Buffer.h	(revision 6)
+++ 	(revision )
@@ -1,241 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_BUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_BUFFER_H
-//------------------------------------------------------------------------------
-
-#include <algorithm>
-
-#include <cstdlib>
-#include <cstring>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for buffers. It maintains a memory area of a certain
- * capacity and the length of the data in the buffer.
- */
-class Buffer
-{
-private:
-    /**
-     * The data itself.
-     */
-    unsigned char* data;
-
-    /**
-     * The capacity of the buffer.
-     */
-    size_t capacity;
-
-    /**
-     * The amount of data in the buffer.
-     */
-    size_t length;
-
-public:
-    /**
-     * Construct the buffer with the given capacity.
-     */
-    Buffer(size_t capacity);
-
-    /**
-     * Destroy the buffer.
-     */
-    ~Buffer();
-
-    /**
-     * Get the capacity of the buffer.
-     */
-    size_t getCapacity() const;
-
-    /**
-     * Get the pointer to the data.
-     */
-    const unsigned char* getData() const;
-
-    /**
-     * Get the pointer to the data for modification.
-     */
-    unsigned char* getData();
-
-    /**
-     * Get the length of the data.
-     */
-    size_t getLength() const;
-
-    /**
-     * Get whether the buffer is empty or not.
-     */
-    bool isEmpty() const;
-
-    /**
-     * Get the available capacity in the buffer.
-     */
-    size_t getAvailable() const;
-
-    /**
-     * Reset the buffer.
-     */
-    void reset();
-
-    /**
-     * Add the given amount to the length. Should not exceed the
-     * capacity!
-     *
-     * @return the actual amount added.
-     */
-    size_t addLength(size_t n);
-
-    /**
-     * Append the given data to the contents of the given buffer.
-     *
-     * @return the number of bytes actually appended
-     */
-    size_t append(const void* src, size_t size);
-
-    /**
-     * Extract data into the given buffer from the given offset.
-     *
-     * @return the number of bytes actually extracted.
-     */
-    size_t extract(void* dest, size_t size, size_t offset = 0) const;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Buffer::Buffer(size_t capacity) :
-    data(new unsigned char[capacity]),
-    capacity(capacity),
-    length(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Buffer::~Buffer()
-{
-    delete[] data;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::getCapacity() const
-{
-    return capacity;
-}
-
-//------------------------------------------------------------------------------
-
-inline const unsigned char* Buffer::getData() const
-{
-    return data;
-}
-
-//------------------------------------------------------------------------------
-
-inline unsigned char* Buffer::getData()
-{
-    return data;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::getLength() const
-{
-    return length;
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Buffer::isEmpty() const
-{
-    return length==0;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::getAvailable() const
-{
-    return capacity - length;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Buffer::reset()
-{
-    length = 0;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::addLength(size_t n)
-{
-    size_t toAdd = std::min(n, getAvailable());
-    length += toAdd;
-    return toAdd;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::append(const void* src, size_t size)
-{
-    size_t toCopy = std::min(size, getAvailable());
-    memcpy(data + length, src, toCopy);
-    length += toCopy;
-    return toCopy;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Buffer::extract(void* dest, size_t size, size_t offset) const
-{
-    size_t toCopy = (offset>=length) ? 0 : std::min(size, length - offset);
-    memcpy(dest, data + offset, toCopy);
-    return toCopy;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_BUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/BufferedStream.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/BufferedStream.h	(revision 8)
@@ -0,0 +1,111 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_BUFFEREDSTREAM_H
+#define HU_VARADIISTVAN_SCPL_IO_BUFFEREDSTREAM_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of BufferedStream
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for streams on which a waiter can wait and provides a
+ * reading and/or a writing buffer.
+ */
+class BufferedStream : public Failable
+{
+public:
+    /**
+     * The default buffer capacity.
+     */
+    static const size_t DEFAULT_CAPACITY = 4096;
+
+public:
+    /**
+     * Destroy the buffered stream.
+     */
+    virtual ~BufferedStream();
+
+    /**
+     * Get the reference of the reading buffer. Note, that it can be a
+     * 0 reference, if the stream has no reading buffer.
+     */
+    ReadingBuffer& getReadingBuffer();
+
+    /**
+     * Get the reference of the writing buffer. Note, that it can be a
+     * 0 reference, if the stream has no writing buffer.
+     */
+    WritingBuffer& getWritingBuffer();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of BufferedStream
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_BUFFEREDSTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/BufferedStream.h	(revision 8)
+++ 	(revision )
@@ -1,111 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_BUFFEREDSTREAM_H
-#define HU_VARADIISTVAN_SCPL_IO_BUFFEREDSTREAM_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of BufferedStream
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for streams on which a waiter can wait and provides a
- * reading and/or a writing buffer.
- */
-class BufferedStream : public Failable
-{
-public:
-    /**
-     * The default buffer capacity.
-     */
-    static const size_t DEFAULT_CAPACITY = 4096;
-
-public:
-    /**
-     * Destroy the buffered stream.
-     */
-    virtual ~BufferedStream();
-
-    /**
-     * Get the reference of the reading buffer. Note, that it can be a
-     * 0 reference, if the stream has no reading buffer.
-     */
-    ReadingBuffer& getReadingBuffer();
-
-    /**
-     * Get the reference of the writing buffer. Note, that it can be a
-     * 0 reference, if the stream has no writing buffer.
-     */
-    WritingBuffer& getWritingBuffer();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of BufferedStream
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/BufferedStream.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/BufferedStream.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_BUFFEREDSTREAM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/BufferedStreamAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/BufferedStreamAcceptor.h	(revision 27)
+++ src/hu/varadiistvan/scpl/io/BufferedStreamAcceptor.h	(revision 27)
@@ -0,0 +1,65 @@
+// Copyright (c) 2022 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#pragma once
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class BufferedStream;
+class Waiter;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Interface for acceptors that accept a buffered stream
+ */
+class BufferedStreamAcceptor
+{
+public:
+    /**
+     * Get the last accepted entity as a buffered stream with the given waiter,
+     * if any.
+     */
+    virtual BufferedStream* getAcceptedBufferedStream(Waiter* waiter = nullptr) = 0;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/DataStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/DataStream.cc	(revision 22)
+++ src/hu/varadiistvan/scpl/io/DataStream.cc	(revision 22)
@@ -0,0 +1,120 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "DataStream.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::DataStream;
+
+using std::string;
+using std::min;
+
+//------------------------------------------------------------------------------
+
+size_t DataStream::readLength()
+{
+    size_t length = 0;
+
+    uint8_t d = 0;
+    unsigned shift = 0;
+    do {
+        d = readU8();
+        length |= static_cast<size_t>(d&0x7f)<<shift;
+        shift += 7;
+    } while( (d&0x80)==0x80 );
+
+    return length;
+}
+
+//------------------------------------------------------------------------------
+
+string DataStream::readString()
+{
+    size_t length = readLength();
+    if (!*this) return "";
+
+    char* buffer = new char[length];
+    if (read(buffer, length)) {
+        string str(buffer, length);
+        delete buffer;
+        return str;
+    } else {
+        delete buffer;
+        return "";
+    }
+}
+
+//------------------------------------------------------------------------------
+
+size_t DataStream::readString(char* dest, size_t capacity)
+{
+    size_t length = readLength();
+    size_t destLength = 0;
+    if (*this && length>0) {
+        size_t destLength = min(length, capacity - 1);
+        if (read(dest, destLength)) {
+            if (destLength<length) {
+                if (!skip(length - destLength)) {
+                    length = destLength = 0;
+                }
+            }
+        } else {
+            length = destLength = 0;
+        }
+    } else {
+        length = 0;
+    }
+
+    dest[destLength] = '\0';
+
+    return length;
+}
+
+//------------------------------------------------------------------------------
+
+bool DataStream::writeLength(size_t length)
+{
+    do {
+        uint8_t x = length&0x7f;
+        length >>= 7;
+        if (length>0) x |= 0x80;
+        if (!writeU8(x)) return false;
+    } while(length>0);
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/DataStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/DataStream.cc	(revision 22)
+++ 	(revision )
@@ -1,120 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "DataStream.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::DataStream;
-
-using std::string;
-using std::min;
-
-//------------------------------------------------------------------------------
-
-size_t DataStream::readLength()
-{
-    size_t length = 0;
-
-    uint8_t d = 0;
-    unsigned shift = 0;
-    do {
-        d = readU8();
-        length |= static_cast<size_t>(d&0x7f)<<shift;
-        shift += 7;
-    } while( (d&0x80)==0x80 );
-
-    return length;
-}
-
-//------------------------------------------------------------------------------
-
-string DataStream::readString()
-{
-    size_t length = readLength();
-    if (!*this) return "";
-
-    char* buffer = new char[length];
-    if (read(buffer, length)) {
-        string str(buffer, length);
-        delete buffer;
-        return str;
-    } else {
-        delete buffer;
-        return "";
-    }
-}
-
-//------------------------------------------------------------------------------
-
-size_t DataStream::readString(char* dest, size_t capacity)
-{
-    size_t length = readLength();
-    size_t destLength = 0;
-    if (*this && length>0) {
-        size_t destLength = min(length, capacity - 1);
-        if (read(dest, destLength)) {
-            if (destLength<length) {
-                if (!skip(length - destLength)) {
-                    length = destLength = 0;
-                }
-            }
-        } else {
-            length = destLength = 0;
-        }
-    } else {
-        length = 0;
-    }
-
-    dest[destLength] = '\0';
-
-    return length;
-}
-
-//------------------------------------------------------------------------------
-
-bool DataStream::writeLength(size_t length)
-{
-    do {
-        uint8_t x = length&0x7f;
-        length >>= 7;
-        if (length>0) x |= 0x80;
-        if (!writeU8(x)) return false;
-    } while(length>0);
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/DataStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/DataStream.h	(revision 10)
+++ src/hu/varadiistvan/scpl/io/DataStream.h	(revision 10)
@@ -0,0 +1,444 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
+#define HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
+//------------------------------------------------------------------------------
+
+#include "BlockingStream.h"
+
+#include <string>
+
+#include <cstring>
+
+#include <inttypes.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A blocking stream with extra functions to read and write values of
+ * basic data types. The values are read and written in host
+ * byte-order, so this stream does not work properly between machines
+ * of different endianness.
+ *
+ * The reading functions return the value read and you can check of
+ * error or interruption only by calling the appropriate
+ * functions. The purpose of this behaviour is that the data could be
+ * read item-by-item without having to check for the stream's
+ * health all the time. Such checks are needed only, if some decision
+ * is made, based on the data. In case of an error, the read functions
+ * return some well-define default value, typically 0.
+ *
+ * The writing functions return a boolean value indicating success or
+ * failure, but writing can be handled the same way as reading from
+ * the point of view of error checking.
+ */
+class DataStream : public BlockingStream
+{
+public:
+    /**
+     * Construct the stream.
+     */
+    DataStream(BufferedStream& stream);
+
+    /**
+     * Template for simple, type-specific reading.
+     */
+    template <typename T> T readT(T defaultValue = 0);
+
+    /**
+     * Read a signed, 8-bit value
+     */
+    int8_t readS8();
+
+    /**
+     * Read an unsigned, 8-bit value
+     */
+    uint8_t readU8();
+
+    /**
+     * Read a signed, 16-bit value
+     */
+    int16_t readS16();
+
+    /**
+     * Read an unsigned, 16-bit value
+     */
+    uint16_t readU16();
+
+    /**
+     * Read a signed, 32-bit value
+     */
+    int32_t readS32();
+
+    /**
+     * Read an unsigned, 32-bit value
+     */
+    uint32_t readU32();
+
+    /**
+     * Read a signed, 64-bit value
+     */
+    int64_t readS64();
+
+    /**
+     * Read an unsigned, 64-bit value
+     */
+    uint64_t readU64();
+
+    /**
+     * Read a float value.
+     */
+    float readFloat();
+
+    /**
+     * Read a double value.
+     */
+    double readDouble();
+
+    /**
+     * Read a long double value.
+     */
+    long double readLongDouble();
+
+    /**
+     * Read a length value. This is a of at most 32 bits, represented
+     * by a variable number of bytes for space efficiency.
+     *
+     * @see writeLength()
+     */
+    size_t readLength();
+
+    /**
+     * Read a string.
+     */
+    std::string readString();
+
+    /**
+     * Read a string into the given buffer. If the string is too large
+     * for the buffer, its end will be discarded. A trailing 0 is
+     * added in cases!
+     *
+     * @return the actual length of the string.
+     */
+    size_t readString(char* dest, size_t capacity);
+
+    /**
+     * Write a signed, 8-bit value
+     */
+    bool writeS8(int8_t x);
+
+    /**
+     * Write an unsigned, 8-bit value
+     */
+    bool writeU8(uint8_t x);
+
+    /**
+     * Write a signed, 16-bit value
+     */
+    bool writeS16(int16_t x);
+
+    /**
+     * Write an unsigned, 16-bit value
+     */
+    bool writeU16(uint16_t x);
+
+    /**
+     * Write a signed, 32-bit value
+     */
+    bool writeS32(int32_t x);
+
+    /**
+     * Write an unsigned, 32-bit value
+     */
+    bool writeU32(uint32_t x);
+
+    /**
+     * Write a signed, 64-bit value
+     */
+    bool writeS64(int64_t x);
+
+    /**
+     * Write an unsigned, 64-bit value
+     */
+    bool writeU64(uint64_t x);
+
+    /**
+     * Write a float value.
+     */
+    bool writeFloat(float x);
+
+    /**
+     * Write a double value.
+     */
+    bool writeDouble(double x);
+
+    /**
+     * Write a long double value.
+     */
+    bool writeLongDouble(long double x);
+
+    /**
+     * Write a length value. This a 32-bit value written as a sequence
+     * of bytes of variable length. A bytes's lower 7 bits contain
+     * parts of the value. The MSB indicates if another byte is left.
+     */
+    bool writeLength(size_t length);
+
+    /**
+     * Write a string. First the string's length is written as a
+     * length (see writeLength()), then the characters of the string
+     * without the trailing 0.
+     */
+    bool writeString(const char* s, size_t length);
+
+    /**
+     * Write a string. First the string's length is written as a
+     * length (see writeLength()), then the characters of the string
+     * without the trailing 0.
+     */
+    bool writeString(const std::string& s);
+
+    /**
+     * Write a string. First the string's length is written as a
+     * length (see writeLength()), then the characters of the string
+     * without the trailing 0.
+     */
+    bool writeString(const char* s);
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline DataStream::DataStream(BufferedStream& stream) :
+    BlockingStream(stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T> T DataStream::readT(T defaultValue)
+{
+    T value = defaultValue;
+    read(&value, sizeof(value));
+    return value;
+}
+
+//------------------------------------------------------------------------------
+
+inline int8_t DataStream::readS8()
+{
+    return readT<int8_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline uint8_t DataStream::readU8()
+{
+    return readT<uint8_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline int16_t DataStream::readS16()
+{
+    return readT<int16_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline uint16_t DataStream::readU16()
+{
+    return readT<uint16_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline int32_t DataStream::readS32()
+{
+    return readT<int32_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline uint32_t DataStream::readU32()
+{
+    return readT<uint32_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline int64_t DataStream::readS64()
+{
+    return readT<int64_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline uint64_t DataStream::readU64()
+{
+    return readT<uint64_t>(0);
+}
+
+//------------------------------------------------------------------------------
+
+inline float DataStream::readFloat()
+{
+    return readT<float>(0.0);
+}
+
+//------------------------------------------------------------------------------
+
+inline double DataStream::readDouble()
+{
+    return readT<double>(0.0);
+}
+
+//------------------------------------------------------------------------------
+
+inline long double DataStream::readLongDouble()
+{
+    return readT<long double>(0.0);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeS8(int8_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeU8(uint8_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeS16(int16_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeU16(uint16_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeS32(int32_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeU32(uint32_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeS64(int64_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeU64(uint64_t x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeFloat(float x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeDouble(double x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeLongDouble(long double x)
+{
+    return write(&x, sizeof(x));
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeString(const char* s, size_t length)
+{
+    if (!writeLength(length)) return false;
+    else return write(s, length);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeString(const std::string& s)
+{
+    return writeString(s.c_str(), s.length());
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataStream::writeString(const char* s)
+{
+    return writeString(s, strlen(s));
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/DataStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/DataStream.h	(revision 10)
+++ 	(revision )
@@ -1,444 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
-#define HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
-//------------------------------------------------------------------------------
-
-#include "BlockingStream.h"
-
-#include <string>
-
-#include <cstring>
-
-#include <inttypes.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A blocking stream with extra functions to read and write values of
- * basic data types. The values are read and written in host
- * byte-order, so this stream does not work properly between machines
- * of different endianness.
- *
- * The reading functions return the value read and you can check of
- * error or interruption only by calling the appropriate
- * functions. The purpose of this behaviour is that the data could be
- * read item-by-item without having to check for the stream's
- * health all the time. Such checks are needed only, if some decision
- * is made, based on the data. In case of an error, the read functions
- * return some well-define default value, typically 0.
- *
- * The writing functions return a boolean value indicating success or
- * failure, but writing can be handled the same way as reading from
- * the point of view of error checking.
- */
-class DataStream : public BlockingStream
-{
-public:
-    /**
-     * Construct the stream.
-     */
-    DataStream(BufferedStream& stream);
-
-    /**
-     * Template for simple, type-specific reading.
-     */
-    template <typename T> T readT(T defaultValue = 0);
-
-    /**
-     * Read a signed, 8-bit value
-     */
-    int8_t readS8();
-
-    /**
-     * Read an unsigned, 8-bit value
-     */
-    uint8_t readU8();
-
-    /**
-     * Read a signed, 16-bit value
-     */
-    int16_t readS16();
-
-    /**
-     * Read an unsigned, 16-bit value
-     */
-    uint16_t readU16();
-
-    /**
-     * Read a signed, 32-bit value
-     */
-    int32_t readS32();
-
-    /**
-     * Read an unsigned, 32-bit value
-     */
-    uint32_t readU32();
-
-    /**
-     * Read a signed, 64-bit value
-     */
-    int64_t readS64();
-
-    /**
-     * Read an unsigned, 64-bit value
-     */
-    uint64_t readU64();
-
-    /**
-     * Read a float value.
-     */
-    float readFloat();
-
-    /**
-     * Read a double value.
-     */
-    double readDouble();
-
-    /**
-     * Read a long double value.
-     */
-    long double readLongDouble();
-
-    /**
-     * Read a length value. This is a of at most 32 bits, represented
-     * by a variable number of bytes for space efficiency.
-     *
-     * @see writeLength()
-     */
-    size_t readLength();
-
-    /**
-     * Read a string.
-     */
-    std::string readString();
-
-    /**
-     * Read a string into the given buffer. If the string is too large
-     * for the buffer, its end will be discarded. A trailing 0 is
-     * added in cases!
-     *
-     * @return the actual length of the string.
-     */
-    size_t readString(char* dest, size_t capacity);
-
-    /**
-     * Write a signed, 8-bit value
-     */
-    bool writeS8(int8_t x);
-
-    /**
-     * Write an unsigned, 8-bit value
-     */
-    bool writeU8(uint8_t x);
-
-    /**
-     * Write a signed, 16-bit value
-     */
-    bool writeS16(int16_t x);
-
-    /**
-     * Write an unsigned, 16-bit value
-     */
-    bool writeU16(uint16_t x);
-
-    /**
-     * Write a signed, 32-bit value
-     */
-    bool writeS32(int32_t x);
-
-    /**
-     * Write an unsigned, 32-bit value
-     */
-    bool writeU32(uint32_t x);
-
-    /**
-     * Write a signed, 64-bit value
-     */
-    bool writeS64(int64_t x);
-
-    /**
-     * Write an unsigned, 64-bit value
-     */
-    bool writeU64(uint64_t x);
-
-    /**
-     * Write a float value.
-     */
-    bool writeFloat(float x);
-
-    /**
-     * Write a double value.
-     */
-    bool writeDouble(double x);
-
-    /**
-     * Write a long double value.
-     */
-    bool writeLongDouble(long double x);
-
-    /**
-     * Write a length value. This a 32-bit value written as a sequence
-     * of bytes of variable length. A bytes's lower 7 bits contain
-     * parts of the value. The MSB indicates if another byte is left.
-     */
-    bool writeLength(size_t length);
-
-    /**
-     * Write a string. First the string's length is written as a
-     * length (see writeLength()), then the characters of the string
-     * without the trailing 0.
-     */
-    bool writeString(const char* s, size_t length);
-
-    /**
-     * Write a string. First the string's length is written as a
-     * length (see writeLength()), then the characters of the string
-     * without the trailing 0.
-     */
-    bool writeString(const std::string& s);
-
-    /**
-     * Write a string. First the string's length is written as a
-     * length (see writeLength()), then the characters of the string
-     * without the trailing 0.
-     */
-    bool writeString(const char* s);
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline DataStream::DataStream(BufferedStream& stream) :
-    BlockingStream(stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T> T DataStream::readT(T defaultValue)
-{
-    T value = defaultValue;
-    read(&value, sizeof(value));
-    return value;
-}
-
-//------------------------------------------------------------------------------
-
-inline int8_t DataStream::readS8()
-{
-    return readT<int8_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline uint8_t DataStream::readU8()
-{
-    return readT<uint8_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline int16_t DataStream::readS16()
-{
-    return readT<int16_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline uint16_t DataStream::readU16()
-{
-    return readT<uint16_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline int32_t DataStream::readS32()
-{
-    return readT<int32_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline uint32_t DataStream::readU32()
-{
-    return readT<uint32_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline int64_t DataStream::readS64()
-{
-    return readT<int64_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline uint64_t DataStream::readU64()
-{
-    return readT<uint64_t>(0);
-}
-
-//------------------------------------------------------------------------------
-
-inline float DataStream::readFloat()
-{
-    return readT<float>(0.0);
-}
-
-//------------------------------------------------------------------------------
-
-inline double DataStream::readDouble()
-{
-    return readT<double>(0.0);
-}
-
-//------------------------------------------------------------------------------
-
-inline long double DataStream::readLongDouble()
-{
-    return readT<long double>(0.0);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeS8(int8_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeU8(uint8_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeS16(int16_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeU16(uint16_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeS32(int32_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeU32(uint32_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeS64(int64_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeU64(uint64_t x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeFloat(float x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeDouble(double x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeLongDouble(long double x)
-{
-    return write(&x, sizeof(x));
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeString(const char* s, size_t length)
-{
-    if (!writeLength(length)) return false;
-    else return write(s, length);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeString(const std::string& s)
-{
-    return writeString(s.c_str(), s.length());
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataStream::writeString(const char* s)
-{
-    return writeString(s, strlen(s));
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_DATASTREAM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/Failable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Failable.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/Failable.h	(revision 6)
@@ -0,0 +1,184 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
+#define HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
+//------------------------------------------------------------------------------
+
+#include "../types.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * An object whose instances can fail, and the reason of the failure
+ * is indicated by an integral error code.
+ */
+class Failable
+{
+private:
+    /**
+     * The error code.
+     */
+    errorCode_t errorCode;
+
+public:
+    /**
+     * Construct the object and initialize the error code to indicate
+     * no error.
+     */
+    Failable();
+
+    /**
+     * Indicate if the object has failed.
+     */
+    bool failed() const;
+
+    /**
+     * Get the error code.
+     */
+    errorCode_t getErrorCode() const;
+
+    /**
+     * Discard the error code.
+     */
+    void repair();
+
+protected:
+    /**
+     * Set the error code.
+     */
+    void setErrorCode(errorCode_t ec);
+};
+
+//------------------------------------------------------------------------------
+
+/**
+ * An object that references another failable object and fails
+ * together with that object.
+ *
+ * The Child class should contain a function named getFailable()
+ * which returns the failable object.
+ */
+template <class Child>
+class FailableReference
+{
+public:
+    /**
+     * Indicate if the referenced object has failed.
+     */
+    bool failed() const;
+
+    /**
+     * Get the error code from the referenced object.
+     */
+    errorCode_t getErrorCode() const;
+
+    /**
+     * Discard the error code of the referenced object.
+     */
+    void repair();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Failable::Failable() :
+    errorCode(XPL_NO_ERROR)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Failable::failed() const
+{
+    return errorCode!=XPL_NO_ERROR;
+}
+
+//------------------------------------------------------------------------------
+
+inline errorCode_t Failable::getErrorCode() const
+{
+    return errorCode;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Failable::repair()
+{
+    errorCode = XPL_NO_ERROR;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Failable::setErrorCode(errorCode_t ec)
+{
+    errorCode = ec;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+template <class Child>
+inline bool FailableReference<Child>::failed() const
+{
+    return static_cast<const Child*>(this)->getFailable().failed();
+}
+
+//------------------------------------------------------------------------------
+
+template <class Child>
+inline errorCode_t FailableReference<Child>::getErrorCode() const
+{
+    return static_cast<const Child*>(this)->getFailable().getErrorCode();
+}
+
+//------------------------------------------------------------------------------
+
+template <class Child>
+inline void FailableReference<Child>::repair()
+{
+    static_cast<Child*>(this)->getFailable().repair();
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/Failable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Failable.h	(revision 6)
+++ 	(revision )
@@ -1,184 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
-#define HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
-//------------------------------------------------------------------------------
-
-#include "../types.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * An object whose instances can fail, and the reason of the failure
- * is indicated by an integral error code.
- */
-class Failable
-{
-private:
-    /**
-     * The error code.
-     */
-    errorCode_t errorCode;
-
-public:
-    /**
-     * Construct the object and initialize the error code to indicate
-     * no error.
-     */
-    Failable();
-
-    /**
-     * Indicate if the object has failed.
-     */
-    bool failed() const;
-
-    /**
-     * Get the error code.
-     */
-    errorCode_t getErrorCode() const;
-
-    /**
-     * Discard the error code.
-     */
-    void repair();
-
-protected:
-    /**
-     * Set the error code.
-     */
-    void setErrorCode(errorCode_t ec);
-};
-
-//------------------------------------------------------------------------------
-
-/**
- * An object that references another failable object and fails
- * together with that object.
- *
- * The Child class should contain a function named getFailable()
- * which returns the failable object.
- */
-template <class Child>
-class FailableReference
-{
-public:
-    /**
-     * Indicate if the referenced object has failed.
-     */
-    bool failed() const;
-
-    /**
-     * Get the error code from the referenced object.
-     */
-    errorCode_t getErrorCode() const;
-
-    /**
-     * Discard the error code of the referenced object.
-     */
-    void repair();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Failable::Failable() :
-    errorCode(XPL_NO_ERROR)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Failable::failed() const
-{
-    return errorCode!=XPL_NO_ERROR;
-}
-
-//------------------------------------------------------------------------------
-
-inline errorCode_t Failable::getErrorCode() const
-{
-    return errorCode;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Failable::repair()
-{
-    errorCode = XPL_NO_ERROR;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Failable::setErrorCode(errorCode_t ec)
-{
-    errorCode = ec;
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-template <class Child>
-inline bool FailableReference<Child>::failed() const
-{
-    return static_cast<const Child*>(this)->getFailable().failed();
-}
-
-//------------------------------------------------------------------------------
-
-template <class Child>
-inline errorCode_t FailableReference<Child>::getErrorCode() const
-{
-    return static_cast<const Child*>(this)->getFailable().getErrorCode();
-}
-
-//------------------------------------------------------------------------------
-
-template <class Child>
-inline void FailableReference<Child>::repair()
-{
-    static_cast<Child*>(this)->getFailable().repair();
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_FAILABLE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalAcceptor.h	(revision 27)
+++ src/hu/varadiistvan/scpl/io/LocalAcceptor.h	(revision 27)
@@ -0,0 +1,127 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALACCEPTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_LOCALACCEPTOR_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of LocalAcceptor
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * An acceptor that provides a LocalSocket for each accepted
+ * connection.
+ */
+class LocalAcceptor : public FailableReference<LocalAcceptor>,
+                      public BufferedStreamAcceptor
+{
+public:
+
+    /**
+     * Start accepting a connection.
+     *
+     * If a connection is already accepted, but not retrieved yet, it
+     * returns true.
+     *
+     * If a new socket becomes immediately available, it returns true.
+     *
+     * If some error occurs, the acceptor is marked as failed.
+     */
+    bool accept();
+
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the given one. If
+     * the server socket has no waiter, this one should be 0. If the
+     * server socket has a waiter, this one should not be 0. In other
+     * words, if the server socket is non-blocking, the accepted one
+     * should also be non-blocking, if the server socket is blocking,
+     * the accepted one should also be blocking.
+     */
+    LocalSocket* getSocket(Waiter* waiter,
+                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the same as that of
+     * the associated server socket.
+     */
+    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+
+    /**
+     * Get the last accepted socket with the given waiter, if any.
+     */
+    BufferedStream* getAcceptedBufferedStream(Waiter* waiter = nullptr) override;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of LocalAcceptor
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/LocalAcceptor.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/LocalAcceptor.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_LOCALACCEPTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalAcceptor.h	(revision 8)
+++ 	(revision )
@@ -1,121 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALACCEPTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_LOCALACCEPTOR_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of LocalAcceptor
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * An acceptor that provides a LocalSocket for each accepted
- * connection.
- */
-class LocalAcceptor : public FailableReference<LocalAcceptor>
-{
-public:
-
-    /**
-     * Start accepting a connection.
-     *
-     * If a connection is already accepted, but not retrieved yet, it
-     * returns true.
-     *
-     * If a new socket becomes immediately available, it returns true.
-     *
-     * If some error occurs, the acceptor is marked as failed.
-     */
-    bool accept();
-
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the given one. If
-     * the server socket has no waiter, this one should be 0. If the
-     * server socket has a waiter, this one should not be 0. In other
-     * words, if the server socket is non-blocking, the accepted one
-     * should also be non-blocking, if the server socket is blocking,
-     * the accepted one should also be blocking.
-     */
-    LocalSocket* getSocket(Waiter* waiter,
-                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the same as that of
-     * the associated server socket.
-     */
-    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of LocalAcceptor
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/LocalAcceptor.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/LocalAcceptor.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_LOCALACCEPTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalClientSocket.h	(revision 16)
+++ src/hu/varadiistvan/scpl/io/LocalClientSocket.h	(revision 16)
@@ -0,0 +1,115 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALCLIENTSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_LOCALCLIENTSOCKET_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of LocalClientSocket
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class LocalConnector;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Client socket that connects to a server socket locally. On Linux it
+ * is a Unix socket, on Windows it is a named pipe.
+ *
+ * The server socket's name should be given.
+ */
+class LocalClientSocket : public BufferedStream
+{
+public:
+    /**
+     * Construct the client socket with the given name.
+     *
+     * @param name the name of the server socket
+     * @param waiter the waiter to use for waiting a possible event
+     * occuring on the socket. If given, the socket will be
+     * non-blocking. Otherwise, it will be blocking, and the connect()
+     * function of the Connector might block as well as the reading
+     * and writing buffers.
+     * @param readingCapacity the capacity of the reading buffer
+     * @param writingCapacity the capacity of the writing buffer
+     */
+    LocalClientSocket(const char* name, Waiter* waiter = 0,
+                      size_t readingCapacity = DEFAULT_CAPACITY,
+                      size_t writingCapacity = DEFAULT_CAPACITY);
+
+    /**
+     * Get the connector. Use this object to connect to another socket.
+     */
+    LocalConnector& getConnector();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of LocalClientSocket
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/LocalClientSocket.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/LocalClientSocket.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_LOCALCLIENTSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalClientSocket.h	(revision 16)
+++ 	(revision )
@@ -1,115 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALCLIENTSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_LOCALCLIENTSOCKET_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of LocalClientSocket
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class LocalConnector;
-
-//------------------------------------------------------------------------------
-
-/**
- * Client socket that connects to a server socket locally. On Linux it
- * is a Unix socket, on Windows it is a named pipe.
- *
- * The server socket's name should be given.
- */
-class LocalClientSocket : public BufferedStream
-{
-public:
-    /**
-     * Construct the client socket with the given name.
-     *
-     * @param name the name of the server socket
-     * @param waiter the waiter to use for waiting a possible event
-     * occuring on the socket. If given, the socket will be
-     * non-blocking. Otherwise, it will be blocking, and the connect()
-     * function of the Connector might block as well as the reading
-     * and writing buffers.
-     * @param readingCapacity the capacity of the reading buffer
-     * @param writingCapacity the capacity of the writing buffer
-     */
-    LocalClientSocket(const char* name, Waiter* waiter = 0,
-                      size_t readingCapacity = DEFAULT_CAPACITY,
-                      size_t writingCapacity = DEFAULT_CAPACITY);
-
-    /**
-     * Get the connector. Use this object to connect to another socket.
-     */
-    LocalConnector& getConnector();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of LocalClientSocket
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/LocalClientSocket.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/LocalClientSocket.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_LOCALCLIENTSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalConnector.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/LocalConnector.h	(revision 8)
@@ -0,0 +1,103 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALCONNECTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_LOCALCONNECTOR_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of LocalConnector
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Class representing the creation of a connection to some remote
+ * entity, like a socket or a pipe. It cannot be created directly,
+ * only acquired from a client socket.
+ */
+class LocalConnector : public FailableReference<LocalConnector>
+{
+public:
+    /**
+     * Connect to an address properly set up.
+     *
+     * If the connection succeeds immediately, it indicates success.
+     *
+     * If the connection does not succeed, because it would block, it
+     * sets up the socket to wait for the connection to succeed, and
+     * returns failure.
+     *
+     * If the connection fails for another reason, the error code is
+     * set, and false is returned.
+     */
+    bool connect();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of LocalConnector
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_LOCALCONNECTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalConnector.h	(revision 8)
+++ 	(revision )
@@ -1,103 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALCONNECTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_LOCALCONNECTOR_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of LocalConnector
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Class representing the creation of a connection to some remote
- * entity, like a socket or a pipe. It cannot be created directly,
- * only acquired from a client socket.
- */
-class LocalConnector : public FailableReference<LocalConnector>
-{
-public:
-    /**
-     * Connect to an address properly set up.
-     *
-     * If the connection succeeds immediately, it indicates success.
-     *
-     * If the connection does not succeed, because it would block, it
-     * sets up the socket to wait for the connection to succeed, and
-     * returns failure.
-     *
-     * If the connection fails for another reason, the error code is
-     * set, and false is returned.
-     */
-    bool connect();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of LocalConnector
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_LOCALCONNECTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalServerSocket.h	(revision 16)
+++ src/hu/varadiistvan/scpl/io/LocalServerSocket.h	(revision 16)
@@ -0,0 +1,110 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALSERVERSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_LOCALSERVERSOCKET_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of LocalServerSocket
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A server socket that provides a local, named access point. On
+ * Linux, it is a Unix socket, on Windows it is a named pipe.
+ *
+ * It is identified by a name that should be unique for the user.
+ */
+class LocalServerSocket
+{
+public:
+    /**
+     * Construct the socket with the given name.
+     *
+     * It will be bound to the name and able to listen for incoming
+     * connections.
+     *
+     * @param name the name of the server socket that can be used by
+     * clients to connect to this socket
+     * @param waiter the waiter to use for waiting a possible event
+     * occuring on the socket. If given, the socket will be
+     * non-blocking. Otherwise, it will be blocking, and the accept()
+     * function of the Acceptor might block.
+     */
+    LocalServerSocket(const char* name, Waiter* waiter = 0);
+
+    /**
+     * Get the acceptor.
+     */
+    LocalAcceptor& getAcceptor();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of LocalServerSocket
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/LocalServerSocket.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/LocalServerSocket.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_LOCALSERVERSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalServerSocket.h	(revision 16)
+++ 	(revision )
@@ -1,110 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALSERVERSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_LOCALSERVERSOCKET_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of LocalServerSocket
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A server socket that provides a local, named access point. On
- * Linux, it is a Unix socket, on Windows it is a named pipe.
- *
- * It is identified by a name that should be unique for the user.
- */
-class LocalServerSocket
-{
-public:
-    /**
-     * Construct the socket with the given name.
-     *
-     * It will be bound to the name and able to listen for incoming
-     * connections.
-     *
-     * @param name the name of the server socket that can be used by
-     * clients to connect to this socket
-     * @param waiter the waiter to use for waiting a possible event
-     * occuring on the socket. If given, the socket will be
-     * non-blocking. Otherwise, it will be blocking, and the accept()
-     * function of the Acceptor might block.
-     */
-    LocalServerSocket(const char* name, Waiter* waiter = 0);
-
-    /**
-     * Get the acceptor.
-     */
-    LocalAcceptor& getAcceptor();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of LocalServerSocket
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/LocalServerSocket.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/LocalServerSocket.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_LOCALSERVERSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/LocalSocket.h	(revision 8)
@@ -0,0 +1,88 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_LOCALSOCKET_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of LocalSocket
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A socket that works on a local connection. On Linux, it is a Unix
+ * socket, on Windows it is a named pipe.
+ */
+class LocalSocket : public BufferedStream
+{
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of LocalSocket
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_LOCALSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/LocalSocket.h	(revision 8)
+++ 	(revision )
@@ -1,88 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_LOCALSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_LOCALSOCKET_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of LocalSocket
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A socket that works on a local connection. On Linux, it is a Unix
- * socket, on Windows it is a named pipe.
- */
-class LocalSocket : public BufferedStream
-{
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of LocalSocket
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_LOCALSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/Makefile.am	(revision 27)
+++ src/hu/varadiistvan/scpl/io/Makefile.am	(revision 27)
@@ -0,0 +1,44 @@
+SUBDIRS=
+
+AM_CPPFLAGS = -I$(top_builddir)/src
+
+if TARGET_API_POSIX
+SUBDIRS+=_posix
+endif
+
+if TARGET_API_WIN32
+SUBDIRS+=_win32
+AM_LDFLAGS=-no-undefined
+endif
+
+noinst_LTLIBRARIES=libvscpl_io.la
+
+libvscpl_io_la_SOURCES=\
+        BlockingStream.cc       \
+        DataStream.cc
+
+if TARGET_API_POSIX
+libvscpl_io_la_LIBADD=_posix/libvscpl_io_posix.la
+endif
+
+if TARGET_API_WIN32
+libvscpl_io_la_LIBADD=_win32/libvscpl_io_win32.la
+endif
+
+include_vscpliodir=$(includedir)/hu/varadiistvan/scpl/io
+include_vscplio_HEADERS=\
+        Buffer.h                \
+        Failable.h              \
+        Waiter.h                \
+        WaitableEvent.h         \
+        ReadingBuffer.h         \
+        WritingBuffer.h         \
+        BufferedStream.h        \
+        BufferedStreamAcceptor.h \
+        LocalConnector.h        \
+        LocalClientSocket.h     \
+        LocalSocket.h           \
+        LocalAcceptor.h         \
+        LocalServerSocket.h     \
+        BlockingStream.h        \
+        DataStream.h
Index: src/hu/varadiistvan/scpl/io/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/Makefile.am	(revision 25)
+++ 	(revision )
@@ -1,43 +1,0 @@
-SUBDIRS=
-
-AM_CPPFLAGS = -I$(top_builddir)/src
-
-if TARGET_API_POSIX
-SUBDIRS+=_posix
-endif
-
-if TARGET_API_WIN32
-SUBDIRS+=_win32
-AM_LDFLAGS=-no-undefined
-endif
-
-noinst_LTLIBRARIES=libvscpl_io.la
-
-libvscpl_io_la_SOURCES=\
-        BlockingStream.cc       \
-        DataStream.cc
-
-if TARGET_API_POSIX
-libvscpl_io_la_LIBADD=_posix/libvscpl_io_posix.la
-endif
-
-if TARGET_API_WIN32
-libvscpl_io_la_LIBADD=_win32/libvscpl_io_win32.la
-endif
-
-include_vscpliodir=$(includedir)/hu/varadiistvan/scpl/io
-include_vscplio_HEADERS=\
-        Buffer.h                \
-        Failable.h              \
-        Waiter.h                \
-        WaitableEvent.h         \
-        ReadingBuffer.h         \
-        WritingBuffer.h         \
-        BufferedStream.h        \
-        LocalConnector.h        \
-        LocalClientSocket.h     \
-        LocalSocket.h           \
-        LocalAcceptor.h         \
-        LocalServerSocket.h     \
-        BlockingStream.h        \
-        DataStream.h
Index: src/hu/varadiistvan/scpl/io/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/ReadingBuffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/ReadingBuffer.h	(revision 6)
@@ -0,0 +1,112 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_READINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_READINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of ReadingBuffer
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for reading from a buffered stream. It cannot be
+ * created directly, only acquired from the stream.
+ *
+ * It should be made empty, and then the function read() should be
+ * called on it. If it returns true, some data could be read. If the
+ * amount of data read is 0, that indicates and end-of-file condition.
+ */
+class ReadingBuffer : public Buffer, public FailableReference<ReadingBuffer>
+{
+public:
+    /**
+     * Read into the buffer using the buffered stream if possible.
+     *
+     * If the buffer contains data, this function returns immediately
+     * with success, so the buffer should be reset before reading.
+     *
+     * If some data can be read immediately, that is stored in the
+     * buffer, and success is indicated. Success is indicated even if
+     * the amount of data read is 0, allowing for signalling the
+     * end-of-file or end-of-connection condition.
+     *
+     * If the reading operation would block, the stream is set up so
+     * that it would read, and failure is returned.
+     *
+     * Otherwise, if the reading operation fails for some other
+     * reason, the buffer's error code is set, so it should always be
+     * checked on a failure!
+     */
+    bool read();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of ReadingBuffer
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/ReadingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/ReadingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_READINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/ReadingBuffer.h	(revision 6)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_READINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_READINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of ReadingBuffer
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for reading from a buffered stream. It cannot be
- * created directly, only acquired from the stream.
- *
- * It should be made empty, and then the function read() should be
- * called on it. If it returns true, some data could be read. If the
- * amount of data read is 0, that indicates and end-of-file condition.
- */
-class ReadingBuffer : public Buffer, public FailableReference<ReadingBuffer>
-{
-public:
-    /**
-     * Read into the buffer using the buffered stream if possible.
-     *
-     * If the buffer contains data, this function returns immediately
-     * with success, so the buffer should be reset before reading.
-     *
-     * If some data can be read immediately, that is stored in the
-     * buffer, and success is indicated. Success is indicated even if
-     * the amount of data read is 0, allowing for signalling the
-     * end-of-file or end-of-connection condition.
-     *
-     * If the reading operation would block, the stream is set up so
-     * that it would read, and failure is returned.
-     *
-     * Otherwise, if the reading operation fails for some other
-     * reason, the buffer's error code is set, so it should always be
-     * checked on a failure!
-     */
-    bool read();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of ReadingBuffer
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/ReadingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/ReadingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_READINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/WaitableEvent.h	(revision 7)
+++ src/hu/varadiistvan/scpl/io/WaitableEvent.h	(revision 7)
@@ -0,0 +1,113 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WAITABLEEVENT_H
+#define HU_VARADIISTVAN_SCPL_IO_WAITABLEEVENT_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of WaitableEvent
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * An event on which one can wait with a waiter.
+ */
+class WaitableEvent : public Failable
+{
+public:
+    /**
+     * Construct the event.
+     *
+     * @param waiter the waiter to be used for waiting. If given, the
+     * check() function will always return immediately. If not given,
+     * the check() function may block and returns only when the event
+     * is fired.
+     */
+    WaitableEvent(Waiter* waiter = 0);
+
+    /**
+     * Destroy the event.
+     */
+    virtual ~WaitableEvent();
+
+    /**
+     * Fire the event.
+     */
+    void fire();
+
+    /**
+     * Check if the event is fired or not. If so, the fired status
+     * will be cleared.
+     */
+    bool check();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of WaitableEvent
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/WaitableEvent.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/WaitableEvent.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WAITABLEEVENT_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/WaitableEvent.h	(revision 7)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WAITABLEEVENT_H
-#define HU_VARADIISTVAN_SCPL_IO_WAITABLEEVENT_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of WaitableEvent
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * An event on which one can wait with a waiter.
- */
-class WaitableEvent : public Failable
-{
-public:
-    /**
-     * Construct the event.
-     *
-     * @param waiter the waiter to be used for waiting. If given, the
-     * check() function will always return immediately. If not given,
-     * the check() function may block and returns only when the event
-     * is fired.
-     */
-    WaitableEvent(Waiter* waiter = 0);
-
-    /**
-     * Destroy the event.
-     */
-    virtual ~WaitableEvent();
-
-    /**
-     * Fire the event.
-     */
-    void fire();
-
-    /**
-     * Check if the event is fired or not. If so, the fired status
-     * will be cleared.
-     */
-    bool check();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of WaitableEvent
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/WaitableEvent.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/WaitableEvent.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WAITABLEEVENT_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Waiter.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/Waiter.h	(revision 6)
@@ -0,0 +1,100 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WAITER_H
+#define HU_VARADIISTVAN_SCPL_IO_WAITER_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of Waiter
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Class that can be used to register waitable objects and then wait
+ * for them. The objects are registered when they created and a Waiter
+ * instance is passed to them.
+ */
+class Waiter : public Failable
+{
+public:
+    /**
+     * Wait for any if the waitables to become ready or until a
+     * timeout expires.
+     *
+     * If any of the waitables are ready, the function returns immediately.
+     *
+     * @return true if any of the waitables has become ready, false if
+     * the timeout occurs.
+     */
+    bool wait(int timeout = -1);
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of Waiter
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/Waiter.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/Waiter.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WAITER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/Waiter.h	(revision 6)
+++ 	(revision )
@@ -1,100 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WAITER_H
-#define HU_VARADIISTVAN_SCPL_IO_WAITER_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of Waiter
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Class that can be used to register waitable objects and then wait
- * for them. The objects are registered when they created and a Waiter
- * instance is passed to them.
- */
-class Waiter : public Failable
-{
-public:
-    /**
-     * Wait for any if the waitables to become ready or until a
-     * timeout expires.
-     *
-     * If any of the waitables are ready, the function returns immediately.
-     *
-     * @return true if any of the waitables has become ready, false if
-     * the timeout occurs.
-     */
-    bool wait(int timeout = -1);
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of Waiter
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/Waiter.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/Waiter.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WAITER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/WritingBuffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/WritingBuffer.h	(revision 6)
@@ -0,0 +1,118 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WRITINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_WRITINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of WritingBuffer
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for writing into a buffered stream.  It cannot be
+ * created directly, only acquired from the stream.
+ *
+ * The data to write should be stored in the buffer. Then write()
+ * should be called. If it returns true, it indicates that all data
+ * has been written. In that case the buffer is automatically emptied.
+ */
+class WritingBuffer : public Buffer, public FailableReference<WritingBuffer>
+{
+public:
+    /**
+     * Reset the buffer. It resets the offset too.
+     */
+    void reset();
+
+    /**
+     * Write the contents of the buffer using the associated buffered
+     * stream.
+     *
+     * If the buffer is empty, the function returns indicating
+     * success.
+     *
+     * If the complete remaining contents could be written, it also indicates
+     * success, and the buffer is reset, ready to be used again.
+     *
+     * If not everything can be written and the write operation
+     * indicates that it would block, this function returns failure
+     * after the stream has been set up  to handle the corresponding
+     * poll events.
+     *
+     * Otherwise, if the writing operation fails for some other
+     * reason, the buffer's error code is set to the error's code and
+     * false is returned.
+     */
+    bool write();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of WritingBuffer
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/WritingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/WritingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_WRITINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/WritingBuffer.h	(revision 6)
+++ 	(revision )
@@ -1,118 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WRITINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_WRITINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of WritingBuffer
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for writing into a buffered stream.  It cannot be
- * created directly, only acquired from the stream.
- *
- * The data to write should be stored in the buffer. Then write()
- * should be called. If it returns true, it indicates that all data
- * has been written. In that case the buffer is automatically emptied.
- */
-class WritingBuffer : public Buffer, public FailableReference<WritingBuffer>
-{
-public:
-    /**
-     * Reset the buffer. It resets the offset too.
-     */
-    void reset();
-
-    /**
-     * Write the contents of the buffer using the associated buffered
-     * stream.
-     *
-     * If the buffer is empty, the function returns indicating
-     * success.
-     *
-     * If the complete remaining contents could be written, it also indicates
-     * success, and the buffer is reset, ready to be used again.
-     *
-     * If not everything can be written and the write operation
-     * indicates that it would block, this function returns failure
-     * after the stream has been set up  to handle the corresponding
-     * poll events.
-     *
-     * Otherwise, if the writing operation fails for some other
-     * reason, the buffer's error code is set to the error's code and
-     * false is returned.
-     */
-    bool write();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of WritingBuffer
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/WritingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/WritingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_WRITINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.copyright	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/.copyright	(revision 6)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/_posix/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.copyright	(revision 6)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/_posix/.guardns
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.guardns	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/.guardns	(revision 6)
@@ -0,0 +1,1 @@
+posix
Index: src/hu/varadiistvan/scpl/io/_posix/.guardns
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.guardns	(revision 6)
+++ 	(revision )
@@ -1,1 +1,0 @@
-posix
Index: src/hu/varadiistvan/scpl/io/_posix/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.namespace	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/.namespace	(revision 6)
@@ -0,0 +1,4 @@
+hu
+varadiistvan
+scpl
+io
Index: src/hu/varadiistvan/scpl/io/_posix/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.namespace	(revision 6)
+++ 	(revision )
@@ -1,4 +1,0 @@
-hu
-varadiistvan
-scpl
-io
Index: src/hu/varadiistvan/scpl/io/_posix/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.srcmessage	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/.srcmessage	(revision 6)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/_posix/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/.srcmessage	(revision 6)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/_posix/Acceptor.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Acceptor.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Acceptor.cc	(revision 8)
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Acceptor.h"
+
+#include "ServerSocket.h"
+
+#include <poll.h>
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Acceptor;
+
+//------------------------------------------------------------------------------
+
+Acceptor::~Acceptor()
+{
+    delete [] address;
+}
+
+//------------------------------------------------------------------------------
+
+bool Acceptor::accept()
+{
+    if (failed()) return false;
+    if (acceptedFD>=0) return true;
+
+    size_t addrlen = addressLength;
+    int result = socket.accept(reinterpret_cast<struct ::sockaddr*>(address),
+                               (address==0) ? 0 : &addrlen);
+    if (result<0) {
+        if (socket.failed()) {
+            socket.events &= ~POLLIN;
+        } else {
+            socket.events |= POLLIN;
+        }
+        return false;
+    } else {
+        acceptedFD = result;
+        socket.events &= ~POLLIN;
+        return true;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Acceptor.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Acceptor.cc	(revision 8)
+++ 	(revision )
@@ -1,79 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Acceptor.h"
-
-#include "ServerSocket.h"
-
-#include <poll.h>
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Acceptor;
-
-//------------------------------------------------------------------------------
-
-Acceptor::~Acceptor()
-{
-    delete [] address;
-}
-
-//------------------------------------------------------------------------------
-
-bool Acceptor::accept()
-{
-    if (failed()) return false;
-    if (acceptedFD>=0) return true;
-
-    size_t addrlen = addressLength;
-    int result = socket.accept(reinterpret_cast<struct ::sockaddr*>(address),
-                               (address==0) ? 0 : &addrlen);
-    if (result<0) {
-        if (socket.failed()) {
-            socket.events &= ~POLLIN;
-        } else {
-            socket.events |= POLLIN;
-        }
-        return false;
-    } else {
-        acceptedFD = result;
-        socket.events &= ~POLLIN;
-        return true;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Acceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Acceptor.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Acceptor.h	(revision 8)
@@ -0,0 +1,164 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include "ServerSocket.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Class representing the accepting of an incoming connection on a
+ * socket.
+ */
+class Acceptor : public FailableReference<Acceptor>
+{
+protected:
+    /**
+     * The socket we belong to.
+     */
+    ServerSocket& socket;
+
+    /**
+     * The file descriptor accepted the last time.
+     */
+    int acceptedFD;
+
+    /**
+     * The buffer for the remote address, if we are interested.
+     */
+    unsigned char* address;
+
+    /**
+     * The length of the remote address buffer.
+     */
+    size_t addressLength;
+
+protected:
+    /**
+     * Construct the acceptor.
+     *
+     * @param addressLength the length of the buffer for the peer
+     * address. If 0, not buffer will be created.
+     */
+    Acceptor(ServerSocket* socket, size_t addressLength = 0);
+
+public:
+    /**
+     * Destroy the acceptor.
+     */
+    virtual ~Acceptor();
+
+    /**
+     * Start accepting a connection.
+     *
+     * If a connection is already accepted, but not retrieved yet, it
+     * returns true.
+     *
+     * If a new socket becomes immediately available, it returns true.
+     *
+     * If some error occurs, the acceptor is marked as failed.
+     */
+    bool accept();
+
+protected:
+    /**
+     * Called when a connection gets processed and we can become ready
+     * for the next one.
+     */
+    void connectionProcessed();
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    Failable& getFailable();
+
+    friend class FailableReference<Acceptor>;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Acceptor::Acceptor(ServerSocket* socket, size_t addressLength) :
+    socket(*socket),
+    acceptedFD(-1),
+    address( (addressLength==0) ? 0 : new unsigned char[addressLength]),
+    addressLength(addressLength)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline void Acceptor::connectionProcessed()
+{
+    acceptedFD = -1;
+}
+
+//------------------------------------------------------------------------------
+
+inline const Failable& Acceptor::getFailable() const
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+inline Failable& Acceptor::getFailable()
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Acceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Acceptor.h	(revision 8)
+++ 	(revision )
@@ -1,164 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include "ServerSocket.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Class representing the accepting of an incoming connection on a
- * socket.
- */
-class Acceptor : public FailableReference<Acceptor>
-{
-protected:
-    /**
-     * The socket we belong to.
-     */
-    ServerSocket& socket;
-
-    /**
-     * The file descriptor accepted the last time.
-     */
-    int acceptedFD;
-
-    /**
-     * The buffer for the remote address, if we are interested.
-     */
-    unsigned char* address;
-
-    /**
-     * The length of the remote address buffer.
-     */
-    size_t addressLength;
-
-protected:
-    /**
-     * Construct the acceptor.
-     *
-     * @param addressLength the length of the buffer for the peer
-     * address. If 0, not buffer will be created.
-     */
-    Acceptor(ServerSocket* socket, size_t addressLength = 0);
-
-public:
-    /**
-     * Destroy the acceptor.
-     */
-    virtual ~Acceptor();
-
-    /**
-     * Start accepting a connection.
-     *
-     * If a connection is already accepted, but not retrieved yet, it
-     * returns true.
-     *
-     * If a new socket becomes immediately available, it returns true.
-     *
-     * If some error occurs, the acceptor is marked as failed.
-     */
-    bool accept();
-
-protected:
-    /**
-     * Called when a connection gets processed and we can become ready
-     * for the next one.
-     */
-    void connectionProcessed();
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    Failable& getFailable();
-
-    friend class FailableReference<Acceptor>;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Acceptor::Acceptor(ServerSocket* socket, size_t addressLength) :
-    socket(*socket),
-    acceptedFD(-1),
-    address( (addressLength==0) ? 0 : new unsigned char[addressLength]),
-    addressLength(addressLength)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline void Acceptor::connectionProcessed()
-{
-    acceptedFD = -1;
-}
-
-//------------------------------------------------------------------------------
-
-inline const Failable& Acceptor::getFailable() const
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-inline Failable& Acceptor::getFailable()
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_ACCEPTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/BufferedStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/BufferedStream.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/BufferedStream.cc	(revision 6)
@@ -0,0 +1,112 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "BufferedStream.h"
+
+#include "ReadingBuffer.h"
+#include "WritingBuffer.h"
+
+#include <unistd.h>
+#include <poll.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::BufferedStream;
+
+//------------------------------------------------------------------------------
+
+BufferedStream::BufferedStream(Waiter* waiter, int fd,
+                                   size_t readingCapacity,
+                                   size_t writingCapacity,
+                                   short events) :
+    Waitable(waiter, fd, events),
+    readingBuffer( (readingCapacity==0) ? 0 :
+                   new ReadingBuffer(readingCapacity, this)),
+    writingBuffer( (writingCapacity==0) ? 0 :
+                   new WritingBuffer(writingCapacity, this))
+{
+}
+
+//------------------------------------------------------------------------------
+
+BufferedStream::~BufferedStream()
+{
+    delete writingBuffer;
+    delete readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+ssize_t BufferedStream::read(void* dest, size_t length)
+{
+    ssize_t result = ::read(fd, dest, length);
+    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
+        setErrorCodeFromErrno();
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+ssize_t BufferedStream::write(const void* src, size_t length)
+{
+    ssize_t result = ::write(fd, src, length);
+    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
+        setErrorCodeFromErrno();
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+bool BufferedStream::isReady()
+{
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+void BufferedStream::handleEvents(short ev)
+{
+    if ((ev&POLLIN)==POLLIN && readingBuffer!=0) {
+        readingBuffer->read();
+    }
+    if ((ev&POLLOUT)==POLLOUT && writingBuffer!=0) {
+        writingBuffer->write();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/BufferedStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/BufferedStream.cc	(revision 6)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "BufferedStream.h"
-
-#include "ReadingBuffer.h"
-#include "WritingBuffer.h"
-
-#include <unistd.h>
-#include <poll.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::BufferedStream;
-
-//------------------------------------------------------------------------------
-
-BufferedStream::BufferedStream(Waiter* waiter, int fd,
-                                   size_t readingCapacity,
-                                   size_t writingCapacity,
-                                   short events) :
-    Waitable(waiter, fd, events),
-    readingBuffer( (readingCapacity==0) ? 0 :
-                   new ReadingBuffer(readingCapacity, this)),
-    writingBuffer( (writingCapacity==0) ? 0 :
-                   new WritingBuffer(writingCapacity, this))
-{
-}
-
-//------------------------------------------------------------------------------
-
-BufferedStream::~BufferedStream()
-{
-    delete writingBuffer;
-    delete readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-ssize_t BufferedStream::read(void* dest, size_t length)
-{
-    ssize_t result = ::read(fd, dest, length);
-    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
-        setErrorCodeFromErrno();
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-ssize_t BufferedStream::write(const void* src, size_t length)
-{
-    ssize_t result = ::write(fd, src, length);
-    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
-        setErrorCodeFromErrno();
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-bool BufferedStream::isReady()
-{
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-void BufferedStream::handleEvents(short ev)
-{
-    if ((ev&POLLIN)==POLLIN && readingBuffer!=0) {
-        readingBuffer->read();
-    }
-    if ((ev&POLLOUT)==POLLOUT && writingBuffer!=0) {
-        writingBuffer->write();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/BufferedStream.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/BufferedStream.h	(revision 6)
@@ -0,0 +1,169 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
+//------------------------------------------------------------------------------
+
+#include "Waitable.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class ReadingBuffer;
+class WritingBuffer;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A waitable that has a read and/or a write buffer associated with
+ * it.
+ */
+class BufferedStream : public Waitable
+{
+public:
+    /**
+     * The default buffer capacity.
+     */
+    static const size_t DEFAULT_CAPACITY = 4096;
+
+private:
+    /**
+     * The reading buffer. It may be 0, if no reading buffer is
+     * associated with this waitable.
+     */
+    ReadingBuffer* readingBuffer;
+
+    /**
+     * The writing buffer. It may be 0, if no writing buffer is
+     * associated with this waitable.
+     */
+    WritingBuffer* writingBuffer;
+
+protected:
+    /**
+     * Construct the buffered waitable with the given capacities of
+     * the reading and writing buffers. If any of the capacities is 0,
+     * the corresponding buffer will not be created.
+     */
+    BufferedStream(Waiter* waiter = 0, int fd = -1,
+                     size_t readingCapacity = DEFAULT_CAPACITY,
+                     size_t writingCapacity = DEFAULT_CAPACITY,
+                     short events = 0);
+
+public:
+    /**
+     * Destroy the buffered waitable.
+     */
+    virtual ~BufferedStream();
+
+    /**
+     * Get the reference of the reading buffer. Note, that it can be a
+     * 0 reference, if the waitable has no reading buffer.
+     */
+    ReadingBuffer& getReadingBuffer();
+
+    /**
+     * Get the reference of the writing buffer. Note, that it can be a
+     * 0 reference, if the waitable has no writing buffer.
+     */
+    WritingBuffer& getWritingBuffer();
+
+protected:
+    /**
+     * Read using the file descriptor at most the given number of
+     * bytes into the given buffer.
+     *
+     * This default implementation uses the read(2) function for
+     * reading.
+     *
+     * @return the number of bytes read (0 in case of end-of-file or
+     * when the connection is closed), -1 on error. In case of error,
+     * the error code will be set up.
+     */
+    virtual ssize_t read(void* dest, size_t length);
+
+    /**
+     * Write using the file descriptor the given number of bytes from
+     * the given buffer.
+     *
+     * This default implementation uses the write(2) function for
+     * writing.
+     *
+     * @return the number of bytes written, or -1 on error. In case of error,
+     * the error code will be set up.
+     */
+    virtual ssize_t write(const void* src, size_t length);
+
+    /**
+     * Check if the waitable is ready.
+     */
+    virtual bool isReady();
+
+    /**
+     * Handle any events on the file descriptor.
+     */
+    virtual void handleEvents(short events);
+
+    friend class ReadingBuffer;
+    friend class WritingBuffer;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ReadingBuffer& BufferedStream::getReadingBuffer()
+{
+    return *readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+inline WritingBuffer& BufferedStream::getWritingBuffer()
+{
+    return *writingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/BufferedStream.h	(revision 6)
+++ 	(revision )
@@ -1,169 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
-//------------------------------------------------------------------------------
-
-#include "Waitable.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class ReadingBuffer;
-class WritingBuffer;
-
-//------------------------------------------------------------------------------
-
-/**
- * A waitable that has a read and/or a write buffer associated with
- * it.
- */
-class BufferedStream : public Waitable
-{
-public:
-    /**
-     * The default buffer capacity.
-     */
-    static const size_t DEFAULT_CAPACITY = 4096;
-
-private:
-    /**
-     * The reading buffer. It may be 0, if no reading buffer is
-     * associated with this waitable.
-     */
-    ReadingBuffer* readingBuffer;
-
-    /**
-     * The writing buffer. It may be 0, if no writing buffer is
-     * associated with this waitable.
-     */
-    WritingBuffer* writingBuffer;
-
-protected:
-    /**
-     * Construct the buffered waitable with the given capacities of
-     * the reading and writing buffers. If any of the capacities is 0,
-     * the corresponding buffer will not be created.
-     */
-    BufferedStream(Waiter* waiter = 0, int fd = -1,
-                     size_t readingCapacity = DEFAULT_CAPACITY,
-                     size_t writingCapacity = DEFAULT_CAPACITY,
-                     short events = 0);
-
-public:
-    /**
-     * Destroy the buffered waitable.
-     */
-    virtual ~BufferedStream();
-
-    /**
-     * Get the reference of the reading buffer. Note, that it can be a
-     * 0 reference, if the waitable has no reading buffer.
-     */
-    ReadingBuffer& getReadingBuffer();
-
-    /**
-     * Get the reference of the writing buffer. Note, that it can be a
-     * 0 reference, if the waitable has no writing buffer.
-     */
-    WritingBuffer& getWritingBuffer();
-
-protected:
-    /**
-     * Read using the file descriptor at most the given number of
-     * bytes into the given buffer.
-     *
-     * This default implementation uses the read(2) function for
-     * reading.
-     *
-     * @return the number of bytes read (0 in case of end-of-file or
-     * when the connection is closed), -1 on error. In case of error,
-     * the error code will be set up.
-     */
-    virtual ssize_t read(void* dest, size_t length);
-
-    /**
-     * Write using the file descriptor the given number of bytes from
-     * the given buffer.
-     *
-     * This default implementation uses the write(2) function for
-     * writing.
-     *
-     * @return the number of bytes written, or -1 on error. In case of error,
-     * the error code will be set up.
-     */
-    virtual ssize_t write(const void* src, size_t length);
-
-    /**
-     * Check if the waitable is ready.
-     */
-    virtual bool isReady();
-
-    /**
-     * Handle any events on the file descriptor.
-     */
-    virtual void handleEvents(short events);
-
-    friend class ReadingBuffer;
-    friend class WritingBuffer;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ReadingBuffer& BufferedStream::getReadingBuffer()
-{
-    return *readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-inline WritingBuffer& BufferedStream::getWritingBuffer()
-{
-    return *writingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_BUFFEREDSTREAM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ClientSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ClientSocket.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/ClientSocket.cc	(revision 8)
@@ -0,0 +1,72 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ClientSocket.h"
+
+#include "Connector.h"
+
+#include <poll.h>
+
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::ClientSocket;
+
+//------------------------------------------------------------------------------
+
+void ClientSocket::handleEvents(short events)
+{
+    if (connector.connecting && (events&POLLOUT)==POLLOUT) {
+        connector.handleWritable();
+        events &= ~POLLOUT;
+    }
+
+    BufferedStream::handleEvents(events);
+}
+
+//------------------------------------------------------------------------------
+
+bool ClientSocket::connect(const struct sockaddr* addr, size_t addrlen)
+{
+    int result = ::connect(fd, addr, addrlen);
+    if (result<0 && errno!=EINPROGRESS) {
+        setErrorCodeFromErrno();
+    }
+    return result>=0;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ClientSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ClientSocket.cc	(revision 8)
+++ 	(revision )
@@ -1,72 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ClientSocket.h"
-
-#include "Connector.h"
-
-#include <poll.h>
-
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::ClientSocket;
-
-//------------------------------------------------------------------------------
-
-void ClientSocket::handleEvents(short events)
-{
-    if (connector.connecting && (events&POLLOUT)==POLLOUT) {
-        connector.handleWritable();
-        events &= ~POLLOUT;
-    }
-
-    BufferedStream::handleEvents(events);
-}
-
-//------------------------------------------------------------------------------
-
-bool ClientSocket::connect(const struct sockaddr* addr, size_t addrlen)
-{
-    int result = ::connect(fd, addr, addrlen);
-    if (result<0 && errno!=EINPROGRESS) {
-        setErrorCodeFromErrno();
-    }
-    return result>=0;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ClientSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/ClientSocket.h	(revision 8)
@@ -0,0 +1,111 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "Socket.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Connector;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A socket that can be connected to another one.
+ */
+class ClientSocket : public Socket
+{
+private:
+    /**
+     * The connector.
+     */
+    Connector& connector;
+
+protected:
+    /**
+     * Construct the socket with the given parameters.
+     */
+    ClientSocket(int domain, int type, Connector& connector,
+                 Waiter* waiter = 0, int protocol = 0,
+                 size_t readingCapacity = DEFAULT_CAPACITY,
+                 size_t writingCapacity = DEFAULT_CAPACITY);
+
+protected:
+    /**
+     * Handle any events on the file descriptor. If a connection is in
+     * progress, and the incoming events have the EPOLLOUT flag set,
+     * the connector is called to handle the event. Then the parent
+     * class' handleEvents function is called.
+     */
+    virtual void handleEvents(short events);
+
+    /**
+     * Connect the socket to the given address.
+     *
+     * @return whether the connection succeeded or not. If it does not
+     * succeeded, it may be either because of the socket being
+     * non-blocking and some time is needed, or because of a failure,
+     * in which case the error code will be set properly.
+     */
+    bool connect(const struct sockaddr* addr, size_t addrlen);
+
+    friend class Connector;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ClientSocket::ClientSocket(int domain, int type, Connector& connector,
+                                  Waiter* waiter, int protocol,
+                                  size_t readingCapacity,
+                                  size_t writingCapacity) :
+    Socket(domain, type, waiter, protocol, readingCapacity, writingCapacity),
+    connector(connector)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ClientSocket.h	(revision 8)
+++ 	(revision )
@@ -1,111 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "Socket.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Connector;
-
-//------------------------------------------------------------------------------
-
-/**
- * A socket that can be connected to another one.
- */
-class ClientSocket : public Socket
-{
-private:
-    /**
-     * The connector.
-     */
-    Connector& connector;
-
-protected:
-    /**
-     * Construct the socket with the given parameters.
-     */
-    ClientSocket(int domain, int type, Connector& connector,
-                 Waiter* waiter = 0, int protocol = 0,
-                 size_t readingCapacity = DEFAULT_CAPACITY,
-                 size_t writingCapacity = DEFAULT_CAPACITY);
-
-protected:
-    /**
-     * Handle any events on the file descriptor. If a connection is in
-     * progress, and the incoming events have the EPOLLOUT flag set,
-     * the connector is called to handle the event. Then the parent
-     * class' handleEvents function is called.
-     */
-    virtual void handleEvents(short events);
-
-    /**
-     * Connect the socket to the given address.
-     *
-     * @return whether the connection succeeded or not. If it does not
-     * succeeded, it may be either because of the socket being
-     * non-blocking and some time is needed, or because of a failure,
-     * in which case the error code will be set properly.
-     */
-    bool connect(const struct sockaddr* addr, size_t addrlen);
-
-    friend class Connector;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ClientSocket::ClientSocket(int domain, int type, Connector& connector,
-                                  Waiter* waiter, int protocol,
-                                  size_t readingCapacity,
-                                  size_t writingCapacity) :
-    Socket(domain, type, waiter, protocol, readingCapacity, writingCapacity),
-    connector(connector)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_CLIENTSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Connector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Connector.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Connector.cc	(revision 8)
@@ -0,0 +1,92 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Connector.h"
+
+#include "ClientSocket.h"
+
+#include <poll.h>
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Connector;
+
+//------------------------------------------------------------------------------
+
+bool Connector::connect()
+{
+    if (connected) return true;
+    if (connecting || failed()) return false;
+
+    size_t addrlen = 0;
+    const struct sockaddr* addr = getAddress(addrlen);
+
+    if (socket.connect(addr, addrlen)) {
+        connected = true;
+        return true;
+    } else if (socket.failed()) {
+        return false;
+    } else {
+        connecting = true;
+        socket.events |= POLLOUT;
+        return false;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void Connector::handleWritable()
+{
+    if (!connecting) return;
+
+    connecting = false;
+    socket.events &= ~POLLOUT;
+
+    int error = 0;
+    socklen_t len = sizeof(error);
+    if (getsockopt(socket.fd, SOL_SOCKET, SO_ERROR, &error, &len)<0) {
+        socket.setErrorCodeFromErrno();
+    } else {
+        if (error==0) {
+            connected = true;
+        } else {
+            socket.setErrorCode(error);
+        }
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Connector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Connector.cc	(revision 8)
+++ 	(revision )
@@ -1,92 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Connector.h"
-
-#include "ClientSocket.h"
-
-#include <poll.h>
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Connector;
-
-//------------------------------------------------------------------------------
-
-bool Connector::connect()
-{
-    if (connected) return true;
-    if (connecting || failed()) return false;
-
-    size_t addrlen = 0;
-    const struct sockaddr* addr = getAddress(addrlen);
-
-    if (socket.connect(addr, addrlen)) {
-        connected = true;
-        return true;
-    } else if (socket.failed()) {
-        return false;
-    } else {
-        connecting = true;
-        socket.events |= POLLOUT;
-        return false;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void Connector::handleWritable()
-{
-    if (!connecting) return;
-
-    connecting = false;
-    socket.events &= ~POLLOUT;
-
-    int error = 0;
-    socklen_t len = sizeof(error);
-    if (getsockopt(socket.fd, SOL_SOCKET, SO_ERROR, &error, &len)<0) {
-        socket.setErrorCodeFromErrno();
-    } else {
-        if (error==0) {
-            connected = true;
-        } else {
-            socket.setErrorCode(error);
-        }
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Connector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Connector.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Connector.h	(revision 8)
@@ -0,0 +1,162 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include "ClientSocket.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+struct sockaddr;
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Class representing the creation of a connection to some remote
+ * entity, like a socket or a pipe.
+ */
+class Connector : public FailableReference<Connector>
+{
+private:
+    /**
+     * The socket on behalf of which the connection is being
+     * performed.
+     */
+    ClientSocket& socket;
+
+    /**
+     * Indicate that we are in the process of connecting.
+     */
+    bool connecting;
+
+    /**
+     * Indicate that we are connected.
+     */
+    bool connected;
+
+protected:
+    /**
+     * Construct the connector.
+     */
+    Connector(ClientSocket* socket);
+
+public:
+    /**
+     * Connect to an address properly set up.
+     *
+     * If the connection succeeds immediately, it indicates success.
+     *
+     * If the connection does not succeed, because it would block, it
+     * sets up the socket to wait for the connection to succeed, and
+     * returns failure.
+     *
+     * If the connection fails for another reason, the error code is
+     * set, and false is returned.
+     */
+    bool connect();
+
+protected:
+    /**
+     * Get the parameters for connecting.
+     */
+    virtual const struct sockaddr* getAddress(size_t& addrlen) = 0;
+
+    /**
+     * Handle the event that the socket is writable.
+     *
+     * If connection is in progress, this function returns
+     * immediately.
+     *
+     * Otherwise it reads the error code using getsockopt(), and if it
+     * indicates success, the connector is set to connected, otherwise
+     * it is set to failed.
+     */
+    void handleWritable();
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    Failable& getFailable();
+
+    friend class FailableReference<Connector>;
+    friend class ClientSocket;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Connector::Connector(ClientSocket* socket) :
+    socket(*socket),
+    connecting(false),
+    connected(false)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline const Failable& Connector::getFailable() const
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+inline Failable& Connector::getFailable()
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Connector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Connector.h	(revision 8)
+++ 	(revision )
@@ -1,162 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include "ClientSocket.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-struct sockaddr;
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Class representing the creation of a connection to some remote
- * entity, like a socket or a pipe.
- */
-class Connector : public FailableReference<Connector>
-{
-private:
-    /**
-     * The socket on behalf of which the connection is being
-     * performed.
-     */
-    ClientSocket& socket;
-
-    /**
-     * Indicate that we are in the process of connecting.
-     */
-    bool connecting;
-
-    /**
-     * Indicate that we are connected.
-     */
-    bool connected;
-
-protected:
-    /**
-     * Construct the connector.
-     */
-    Connector(ClientSocket* socket);
-
-public:
-    /**
-     * Connect to an address properly set up.
-     *
-     * If the connection succeeds immediately, it indicates success.
-     *
-     * If the connection does not succeed, because it would block, it
-     * sets up the socket to wait for the connection to succeed, and
-     * returns failure.
-     *
-     * If the connection fails for another reason, the error code is
-     * set, and false is returned.
-     */
-    bool connect();
-
-protected:
-    /**
-     * Get the parameters for connecting.
-     */
-    virtual const struct sockaddr* getAddress(size_t& addrlen) = 0;
-
-    /**
-     * Handle the event that the socket is writable.
-     *
-     * If connection is in progress, this function returns
-     * immediately.
-     *
-     * Otherwise it reads the error code using getsockopt(), and if it
-     * indicates success, the connector is set to connected, otherwise
-     * it is set to failed.
-     */
-    void handleWritable();
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    Failable& getFailable();
-
-    friend class FailableReference<Connector>;
-    friend class ClientSocket;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Connector::Connector(ClientSocket* socket) :
-    socket(*socket),
-    connecting(false),
-    connected(false)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline const Failable& Connector::getFailable() const
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-inline Failable& Connector::getFailable()
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_CONNECTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalAcceptor.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalAcceptor.h	(revision 8)
@@ -0,0 +1,121 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
+//------------------------------------------------------------------------------
+
+#include "Acceptor.h"
+
+#include "LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * An acceptor that provides a LocalSocket for each accepted
+ * connection.
+ */
+class LocalAcceptor : public Acceptor
+{
+private:
+    /**
+     * Construct the acceptor.
+     *
+     * @param addressLength the length of the buffer for the peer
+     * address. If 0, not buffer will be created.
+     */
+    LocalAcceptor(ServerSocket* socket);
+
+public:
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the given one
+     * (which can be 0).
+     */
+    LocalSocket* getSocket(Waiter* waiter,
+                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the same as that of
+     * the associated server socket.
+     */
+    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+
+
+    friend class LocalServerSocket;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalAcceptor::LocalAcceptor(ServerSocket* socket) :
+    Acceptor(socket)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalSocket* LocalAcceptor::getSocket(Waiter* waiter,
+                                             size_t readingCapacity,
+                                             size_t writingCapacity)
+{
+    if (acceptedFD<0) return 0;
+
+    LocalSocket* socket = new LocalSocket(acceptedFD, waiter,
+                                          readingCapacity, writingCapacity);
+    connectionProcessed();
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalSocket* LocalAcceptor::getSocket(size_t readingCapacity,
+                                             size_t writingCapacity)
+{
+    return getSocket(socket.getWaiter(), readingCapacity, writingCapacity);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalAcceptor.h	(revision 8)
+++ 	(revision )
@@ -1,121 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
-//------------------------------------------------------------------------------
-
-#include "Acceptor.h"
-
-#include "LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * An acceptor that provides a LocalSocket for each accepted
- * connection.
- */
-class LocalAcceptor : public Acceptor
-{
-private:
-    /**
-     * Construct the acceptor.
-     *
-     * @param addressLength the length of the buffer for the peer
-     * address. If 0, not buffer will be created.
-     */
-    LocalAcceptor(ServerSocket* socket);
-
-public:
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the given one
-     * (which can be 0).
-     */
-    LocalSocket* getSocket(Waiter* waiter,
-                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the same as that of
-     * the associated server socket.
-     */
-    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-
-
-    friend class LocalServerSocket;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalAcceptor::LocalAcceptor(ServerSocket* socket) :
-    Acceptor(socket)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalSocket* LocalAcceptor::getSocket(Waiter* waiter,
-                                             size_t readingCapacity,
-                                             size_t writingCapacity)
-{
-    if (acceptedFD<0) return 0;
-
-    LocalSocket* socket = new LocalSocket(acceptedFD, waiter,
-                                          readingCapacity, writingCapacity);
-    connectionProcessed();
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalSocket* LocalAcceptor::getSocket(size_t readingCapacity,
-                                             size_t writingCapacity)
-{
-    return getSocket(socket.getWaiter(), readingCapacity, writingCapacity);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALACCEPTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.cc	(revision 8)
@@ -0,0 +1,58 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalClientSocket.h"
+
+#include "LocalConnector.h"
+
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalClientSocket;
+
+//------------------------------------------------------------------------------
+
+LocalClientSocket::LocalClientSocket(const char* name, Waiter* waiter,
+                                     size_t readingCapacity,
+                                     size_t writingCapacity) :
+    ClientSocket(AF_UNIX, SOCK_STREAM, connector, waiter, 0,
+                 readingCapacity, writingCapacity),
+    connector(this, name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.cc	(revision 8)
+++ 	(revision )
@@ -1,58 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalClientSocket.h"
-
-#include "LocalConnector.h"
-
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalClientSocket;
-
-//------------------------------------------------------------------------------
-
-LocalClientSocket::LocalClientSocket(const char* name, Waiter* waiter,
-                                     size_t readingCapacity,
-                                     size_t writingCapacity) :
-    ClientSocket(AF_UNIX, SOCK_STREAM, connector, waiter, 0,
-                 readingCapacity, writingCapacity),
-    connector(this, name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.h	(revision 8)
@@ -0,0 +1,100 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "ClientSocket.h"
+
+#include "LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Client socket that connects to a server socket locally (i.e. a Unit
+ * socket).
+ *
+ * The server socket's name should be given. The name will be used as
+ * described for LocalServerSocket.
+ */
+class LocalClientSocket : public ClientSocket
+{
+private:
+    /**
+     * The address to use for connecting.
+     */
+    LocalConnector connector;
+
+public:
+    /**
+     * Construct the client socket with the given name.
+     *
+     * @param waiter the waiter to use for waiting a possible event
+     * occuring on the socket. If given, the socket will be
+     * non-blocking. Otherwise, it will be blocking, and the connect()
+     * function of the Connector might block as well as the reading
+     * and writing buffers.
+     */
+    LocalClientSocket(const char* name, Waiter* waiter = 0,
+                      size_t readingCapacity = DEFAULT_CAPACITY,
+                      size_t writingCapacity = DEFAULT_CAPACITY);
+
+    /**
+     * Get the connector for this client.
+     */
+    LocalConnector& getConnector();
+
+    friend class LocalConnector;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalConnector& LocalClientSocket::getConnector()
+{
+    return connector;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalClientSocket.h	(revision 8)
+++ 	(revision )
@@ -1,100 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "ClientSocket.h"
-
-#include "LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Client socket that connects to a server socket locally (i.e. a Unit
- * socket).
- *
- * The server socket's name should be given. The name will be used as
- * described for LocalServerSocket.
- */
-class LocalClientSocket : public ClientSocket
-{
-private:
-    /**
-     * The address to use for connecting.
-     */
-    LocalConnector connector;
-
-public:
-    /**
-     * Construct the client socket with the given name.
-     *
-     * @param waiter the waiter to use for waiting a possible event
-     * occuring on the socket. If given, the socket will be
-     * non-blocking. Otherwise, it will be blocking, and the connect()
-     * function of the Connector might block as well as the reading
-     * and writing buffers.
-     */
-    LocalClientSocket(const char* name, Waiter* waiter = 0,
-                      size_t readingCapacity = DEFAULT_CAPACITY,
-                      size_t writingCapacity = DEFAULT_CAPACITY);
-
-    /**
-     * Get the connector for this client.
-     */
-    LocalConnector& getConnector();
-
-    friend class LocalConnector;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalConnector& LocalClientSocket::getConnector()
-{
-    return connector;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCLIENTSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalConnector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalConnector.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalConnector.cc	(revision 8)
@@ -0,0 +1,51 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalConnector;
+
+//------------------------------------------------------------------------------
+
+const struct sockaddr* LocalConnector::getAddress(size_t& addrlen)
+{
+    addrlen = sizeof(address);
+    return reinterpret_cast<const struct sockaddr*>(&address);
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalConnector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalConnector.cc	(revision 8)
+++ 	(revision )
@@ -1,51 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalConnector;
-
-//------------------------------------------------------------------------------
-
-const struct sockaddr* LocalConnector::getAddress(size_t& addrlen)
-{
-    addrlen = sizeof(address);
-    return reinterpret_cast<const struct sockaddr*>(&address);
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalConnector.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalConnector.h	(revision 8)
@@ -0,0 +1,89 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
+//------------------------------------------------------------------------------
+
+#include "Connector.h"
+
+#include "LocalServerSocket.h"
+
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * The connector class used by the local client socket.
+ */
+class LocalConnector : public Connector
+{
+private:
+    /**
+     * The reference to the corresponding socket's address.
+     */
+    struct sockaddr_un address;
+
+public:
+    /**
+     * Create the connector for the given local client socket.
+     */
+    LocalConnector(ClientSocket* socket, const char* name);
+
+protected:
+    /**
+     * Get the address.
+     */
+    virtual const struct sockaddr* getAddress(size_t& addrlen);
+};
+
+//------------------------------------------------------------------------------
+
+inline LocalConnector::LocalConnector(ClientSocket* socket, const char* name) :
+    Connector(socket)
+{
+    address.sun_family = AF_UNIX;
+    LocalServerSocket::setupPath(address, name);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalConnector.h	(revision 8)
+++ 	(revision )
@@ -1,89 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
-//------------------------------------------------------------------------------
-
-#include "Connector.h"
-
-#include "LocalServerSocket.h"
-
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * The connector class used by the local client socket.
- */
-class LocalConnector : public Connector
-{
-private:
-    /**
-     * The reference to the corresponding socket's address.
-     */
-    struct sockaddr_un address;
-
-public:
-    /**
-     * Create the connector for the given local client socket.
-     */
-    LocalConnector(ClientSocket* socket, const char* name);
-
-protected:
-    /**
-     * Get the address.
-     */
-    virtual const struct sockaddr* getAddress(size_t& addrlen);
-};
-
-//------------------------------------------------------------------------------
-
-inline LocalConnector::LocalConnector(ClientSocket* socket, const char* name) :
-    Connector(socket)
-{
-    address.sun_family = AF_UNIX;
-    LocalServerSocket::setupPath(address, name);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALCONNECTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.cc	(revision 8)
@@ -0,0 +1,109 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalServerSocket.h"
+
+#include <cstdio>
+
+#include <pwd.h>
+#include <unistd.h>
+#include <poll.h>
+
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalServerSocket;
+
+//------------------------------------------------------------------------------
+
+void LocalServerSocket::setupPath(struct sockaddr_un& addr, const char* name)
+{
+#ifndef P_tmpdir
+#define P_tmpdir "/tmp"
+#endif
+    struct passwd* passwd = getpwuid(geteuid());
+    const char* userName = (passwd==0) ? "unknown" : passwd->pw_name;
+    snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s-%s",
+             P_tmpdir, name, userName);
+}
+
+//------------------------------------------------------------------------------
+
+LocalServerSocket::LocalServerSocket(const char* name, Waiter* waiter) :
+    ServerSocket(AF_UNIX, SOCK_STREAM, waiter),
+    acceptor(this)
+{
+    sun.sun_family = AF_UNIX;
+    setupPath(sun, name);
+
+    unlink(sun.sun_path);
+
+    if (bind(reinterpret_cast<struct sockaddr*>(&sun), sizeof(sun), false)<0) {
+        setErrorCode(errno);
+        return;
+    }
+
+    if (listen()<0) {
+        setErrorCode(errno);
+        return;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+LocalServerSocket::~LocalServerSocket()
+{
+    unlink(sun.sun_path);
+}
+
+//------------------------------------------------------------------------------
+
+bool LocalServerSocket::isReady()
+{
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+void LocalServerSocket::handleEvents(short events)
+{
+    if ((events&POLLIN)==POLLIN) {
+        acceptor.accept();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.cc	(revision 8)
+++ 	(revision )
@@ -1,109 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalServerSocket.h"
-
-#include <cstdio>
-
-#include <pwd.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalServerSocket;
-
-//------------------------------------------------------------------------------
-
-void LocalServerSocket::setupPath(struct sockaddr_un& addr, const char* name)
-{
-#ifndef P_tmpdir
-#define P_tmpdir "/tmp"
-#endif
-    struct passwd* passwd = getpwuid(geteuid());
-    const char* userName = (passwd==0) ? "unknown" : passwd->pw_name;
-    snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/%s-%s",
-             P_tmpdir, name, userName);
-}
-
-//------------------------------------------------------------------------------
-
-LocalServerSocket::LocalServerSocket(const char* name, Waiter* waiter) :
-    ServerSocket(AF_UNIX, SOCK_STREAM, waiter),
-    acceptor(this)
-{
-    sun.sun_family = AF_UNIX;
-    setupPath(sun, name);
-
-    unlink(sun.sun_path);
-
-    if (bind(reinterpret_cast<struct sockaddr*>(&sun), sizeof(sun), false)<0) {
-        setErrorCode(errno);
-        return;
-    }
-
-    if (listen()<0) {
-        setErrorCode(errno);
-        return;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-LocalServerSocket::~LocalServerSocket()
-{
-    unlink(sun.sun_path);
-}
-
-//------------------------------------------------------------------------------
-
-bool LocalServerSocket::isReady()
-{
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-void LocalServerSocket::handleEvents(short events)
-{
-    if ((events&POLLIN)==POLLIN) {
-        acceptor.accept();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.h	(revision 8)
@@ -0,0 +1,130 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "ServerSocket.h"
+
+#include "LocalAcceptor.h"
+
+#include <sys/un.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A server socket that works locally, i.e. a Unix socket.
+ *
+ * It is identified by a name that should be unique for the user. The
+ * actual socket will be created with the name /tmp/<name>-<username>.
+ */
+class LocalServerSocket : public ServerSocket
+{
+public:
+    /**
+     * Fill in the path of the socket with the given name.
+     */
+    static void setupPath(struct sockaddr_un& addr, const char* name);
+
+private:
+    /**
+     * Our address (to be used when deleting the file in the
+     * destructor.
+     */
+    struct sockaddr_un sun;
+
+    /**
+     * The acceptor to use for accepting connections.
+     */
+    LocalAcceptor acceptor;
+
+public:
+    /**
+     * Construct the socket with the given name.
+     *
+     * It will be bound to the name and able to listen for incoming
+     * connections.
+     *
+     * @param waiter the waiter to use for waiting a possible event
+     * occuring on the socket. If given, the socket will be
+     * non-blocking. Otherwise, it will be blocking, and the accept()
+     * function of the Acceptor might block.
+     */
+    LocalServerSocket(const char* name, Waiter* waiter = 0);
+
+    /**
+     * Destroy the socket by deleting the file.
+     */
+    virtual ~LocalServerSocket();
+
+    /**
+     * Get the acceptor.
+     */
+    LocalAcceptor& getAcceptor();
+
+protected:
+    /**
+     * Indicate if the waitable is ready, i.e. there is no need to
+     * wait for it.
+     */
+    virtual bool isReady();
+
+    /**
+     * Handle the given events.
+     */
+    virtual void handleEvents(short events);
+
+    friend class LocalAcceptor;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalAcceptor& LocalServerSocket::getAcceptor()
+{
+    return acceptor;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalServerSocket.h	(revision 8)
+++ 	(revision )
@@ -1,130 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "ServerSocket.h"
-
-#include "LocalAcceptor.h"
-
-#include <sys/un.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A server socket that works locally, i.e. a Unix socket.
- *
- * It is identified by a name that should be unique for the user. The
- * actual socket will be created with the name /tmp/<name>-<username>.
- */
-class LocalServerSocket : public ServerSocket
-{
-public:
-    /**
-     * Fill in the path of the socket with the given name.
-     */
-    static void setupPath(struct sockaddr_un& addr, const char* name);
-
-private:
-    /**
-     * Our address (to be used when deleting the file in the
-     * destructor.
-     */
-    struct sockaddr_un sun;
-
-    /**
-     * The acceptor to use for accepting connections.
-     */
-    LocalAcceptor acceptor;
-
-public:
-    /**
-     * Construct the socket with the given name.
-     *
-     * It will be bound to the name and able to listen for incoming
-     * connections.
-     *
-     * @param waiter the waiter to use for waiting a possible event
-     * occuring on the socket. If given, the socket will be
-     * non-blocking. Otherwise, it will be blocking, and the accept()
-     * function of the Acceptor might block.
-     */
-    LocalServerSocket(const char* name, Waiter* waiter = 0);
-
-    /**
-     * Destroy the socket by deleting the file.
-     */
-    virtual ~LocalServerSocket();
-
-    /**
-     * Get the acceptor.
-     */
-    LocalAcceptor& getAcceptor();
-
-protected:
-    /**
-     * Indicate if the waitable is ready, i.e. there is no need to
-     * wait for it.
-     */
-    virtual bool isReady();
-
-    /**
-     * Handle the given events.
-     */
-    virtual void handleEvents(short events);
-
-    friend class LocalAcceptor;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalAcceptor& LocalServerSocket::getAcceptor()
-{
-    return acceptor;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSERVERSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/LocalSocket.h	(revision 8)
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "Socket.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A socket that works on a local (Unix) connection.
+ */
+class LocalSocket : public Socket
+{
+private:
+    /**
+     * Construct the socket with the given parameters.
+     */
+    LocalSocket(int fd, Waiter* waiter = 0,
+                size_t readingCapacity = DEFAULT_CAPACITY,
+                size_t writingCapacity = DEFAULT_CAPACITY);
+
+    friend class LocalAcceptor;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalSocket::LocalSocket(int fd, Waiter* waiter,
+                                size_t readingCapacity,
+                                size_t writingCapacity) :
+    Socket(fd, waiter, readingCapacity, writingCapacity)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/LocalSocket.h	(revision 8)
+++ 	(revision )
@@ -1,79 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "Socket.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A socket that works on a local (Unix) connection.
- */
-class LocalSocket : public Socket
-{
-private:
-    /**
-     * Construct the socket with the given parameters.
-     */
-    LocalSocket(int fd, Waiter* waiter = 0,
-                size_t readingCapacity = DEFAULT_CAPACITY,
-                size_t writingCapacity = DEFAULT_CAPACITY);
-
-    friend class LocalAcceptor;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalSocket::LocalSocket(int fd, Waiter* waiter,
-                                size_t readingCapacity,
-                                size_t writingCapacity) :
-    Socket(fd, waiter, readingCapacity, writingCapacity)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_LOCALSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Makefile.am	(revision 25)
+++ src/hu/varadiistvan/scpl/io/_posix/Makefile.am	(revision 25)
@@ -0,0 +1,41 @@
+AM_CPPFLAGS=-I$(top_builddir)/src
+
+SUBDIRS=
+
+noinst_LTLIBRARIES=libvscpl_io_posix.la
+
+libvscpl_io_posix_la_SOURCES=   \
+        Waitable.cc             \
+        Waiter.cc               \
+        WaitableEvent.cc        \
+        BufferedStream.cc       \
+        ReadingBuffer.cc        \
+        WritingBuffer.cc        \
+        Socket.cc               \
+        Connector.cc            \
+        ClientSocket.cc         \
+        LocalConnector.cc       \
+        LocalClientSocket.cc    \
+        Acceptor.cc             \
+        ServerSocket.cc         \
+        LocalServerSocket.cc
+
+include_vscpl_io_posixdir=$(includedir)/hu/varadiistvan/scpl/io/_posix
+include_vscpl_io_posix_HEADERS= \
+        Waitable.h              \
+        Waiter.h                \
+        WaitableEvent.h         \
+        BufferedStream.h        \
+        StreamBuffer.h          \
+        ReadingBuffer.h         \
+        WritingBuffer.h         \
+        Socket.h                \
+        Connector.h             \
+        ClientSocket.h          \
+        LocalConnector.h        \
+        LocalClientSocket.h     \
+        Acceptor.h              \
+        ServerSocket.h          \
+        LocalSocket.h           \
+        LocalAcceptor.h         \
+        LocalServerSocket.h
Index: src/hu/varadiistvan/scpl/io/_posix/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Makefile.am	(revision 25)
+++ 	(revision )
@@ -1,41 +1,0 @@
-AM_CPPFLAGS=-I$(top_builddir)/src
-
-SUBDIRS=
-
-noinst_LTLIBRARIES=libvscpl_io_posix.la
-
-libvscpl_io_posix_la_SOURCES=   \
-        Waitable.cc             \
-        Waiter.cc               \
-        WaitableEvent.cc        \
-        BufferedStream.cc       \
-        ReadingBuffer.cc        \
-        WritingBuffer.cc        \
-        Socket.cc               \
-        Connector.cc            \
-        ClientSocket.cc         \
-        LocalConnector.cc       \
-        LocalClientSocket.cc    \
-        Acceptor.cc             \
-        ServerSocket.cc         \
-        LocalServerSocket.cc
-
-include_vscpl_io_posixdir=$(includedir)/hu/varadiistvan/scpl/io/_posix
-include_vscpl_io_posix_HEADERS= \
-        Waitable.h              \
-        Waiter.h                \
-        WaitableEvent.h         \
-        BufferedStream.h        \
-        StreamBuffer.h          \
-        ReadingBuffer.h         \
-        WritingBuffer.h         \
-        Socket.h                \
-        Connector.h             \
-        ClientSocket.h          \
-        LocalConnector.h        \
-        LocalClientSocket.h     \
-        Acceptor.h              \
-        ServerSocket.h          \
-        LocalSocket.h           \
-        LocalAcceptor.h         \
-        LocalServerSocket.h
Index: src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.cc	(revision 6)
@@ -0,0 +1,76 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ReadingBuffer.h"
+
+#include "BufferedStream.h"
+
+#include <cassert>
+
+#include <poll.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::ReadingBuffer;
+
+//------------------------------------------------------------------------------
+
+bool ReadingBuffer::read()
+{
+    if (failed()) return false;
+
+    if (getLength()>0) {
+        stream.events &= ~POLLIN;
+        return true;
+    }
+
+    ssize_t result = stream.read(getData(), getCapacity());
+    if (result<0) {
+        if (stream.failed()) {
+            stream.events &= ~POLLIN;
+        } else {
+            stream.events |= POLLIN;
+        }
+    } else {
+        stream.events &= ~POLLIN;
+        size_t added = addLength(result);
+        assert(static_cast<ssize_t>(added)==result);
+        assert(static_cast<ssize_t>(getLength())==result);
+    }
+    return result>=0;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.cc	(revision 6)
+++ 	(revision )
@@ -1,76 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ReadingBuffer.h"
-
-#include "BufferedStream.h"
-
-#include <cassert>
-
-#include <poll.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::ReadingBuffer;
-
-//------------------------------------------------------------------------------
-
-bool ReadingBuffer::read()
-{
-    if (failed()) return false;
-
-    if (getLength()>0) {
-        stream.events &= ~POLLIN;
-        return true;
-    }
-
-    ssize_t result = stream.read(getData(), getCapacity());
-    if (result<0) {
-        if (stream.failed()) {
-            stream.events &= ~POLLIN;
-        } else {
-            stream.events |= POLLIN;
-        }
-    } else {
-        stream.events &= ~POLLIN;
-        size_t added = addLength(result);
-        assert(static_cast<ssize_t>(added)==result);
-        assert(static_cast<ssize_t>(getLength())==result);
-    }
-    return result>=0;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.h	(revision 6)
@@ -0,0 +1,100 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "StreamBuffer.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for reading.
+ *
+ * It should be made empty, and then the function read() should be
+ * called on it. If it returns true, some data could be read. If the
+ * amount of data read is 0, that indicates and end-of-file condition.
+ */
+class ReadingBuffer : public StreamBuffer
+{
+protected:
+    /**
+     * Construct the buffer.
+     */
+    ReadingBuffer(size_t capacity, BufferedStream* stream);
+
+public:
+    /**
+     * Read into the buffer using the buffered stream if possible.
+     *
+     * If the buffer contains data, this function returns immediately
+     * with success, so the buffer should be reset before reading.
+     *
+     * If some data can be read immediately, that is stored in the
+     * buffer, and success is indicated. Success is indicated even if
+     * the amount of data read is 0, allowing for signalling the
+     * end-of-file or end-of-connection condition.
+     *
+     * If the reading operation would block, the stream is set up so
+     * that it would read, and failure is returned.
+     *
+     * Otherwise, if the reading operation fails for some other
+     * reason, the buffer's error code is set, so it should always be
+     * checked on a failure!
+     */
+    bool read();
+
+    friend class BufferedStream;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ReadingBuffer::ReadingBuffer(size_t capacity, BufferedStream* stream) :
+    StreamBuffer(capacity, stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ReadingBuffer.h	(revision 6)
+++ 	(revision )
@@ -1,100 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "StreamBuffer.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for reading.
- *
- * It should be made empty, and then the function read() should be
- * called on it. If it returns true, some data could be read. If the
- * amount of data read is 0, that indicates and end-of-file condition.
- */
-class ReadingBuffer : public StreamBuffer
-{
-protected:
-    /**
-     * Construct the buffer.
-     */
-    ReadingBuffer(size_t capacity, BufferedStream* stream);
-
-public:
-    /**
-     * Read into the buffer using the buffered stream if possible.
-     *
-     * If the buffer contains data, this function returns immediately
-     * with success, so the buffer should be reset before reading.
-     *
-     * If some data can be read immediately, that is stored in the
-     * buffer, and success is indicated. Success is indicated even if
-     * the amount of data read is 0, allowing for signalling the
-     * end-of-file or end-of-connection condition.
-     *
-     * If the reading operation would block, the stream is set up so
-     * that it would read, and failure is returned.
-     *
-     * Otherwise, if the reading operation fails for some other
-     * reason, the buffer's error code is set, so it should always be
-     * checked on a failure!
-     */
-    bool read();
-
-    friend class BufferedStream;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ReadingBuffer::ReadingBuffer(size_t capacity, BufferedStream* stream) :
-    StreamBuffer(capacity, stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_READINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ServerSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ServerSocket.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/ServerSocket.cc	(revision 8)
@@ -0,0 +1,112 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ServerSocket.h"
+
+#include "Socket.h"
+
+#include <unistd.h>
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::ServerSocket;
+using hu::varadiistvan::scpl::io::Acceptor;
+
+//------------------------------------------------------------------------------
+
+ServerSocket::ServerSocket(int domain, int type, Waiter* waiter, int protocol) :
+    Waitable(waiter, Socket::socket(domain, type, protocol))
+{
+    if (fd<0) setErrorCodeFromErrno();
+    else if (waiter!=0) setNonBlocking(fd);
+}
+
+//------------------------------------------------------------------------------
+
+ServerSocket::~ServerSocket()
+{
+    if (fd>=0) ::close(fd);
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerSocket::bind(const struct sockaddr* addr, size_t addrlen,
+                        bool reuseaddr)
+{
+    if (reuseaddr) {
+        int reuse = 1;
+        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))<0) {
+            setErrorCodeFromErrno();
+            return false;
+        }
+    }
+
+    if (::bind(fd, addr, addrlen)<0) {
+        setErrorCodeFromErrno();
+        return false;
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerSocket::listen(int backlog)
+{
+    if (::listen(fd, backlog)<0) {
+        setErrorCodeFromErrno();
+        return false;
+    } else {
+        return true;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+int ServerSocket::accept(struct sockaddr* addr, size_t* addrlen)
+{
+    socklen_t alen = (addrlen==0) ? 0 : *addrlen;
+    int result = ::accept(fd, addr, (addrlen==0) ? 0 : &alen);
+    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
+        setErrorCodeFromErrno();
+    } else {
+        if (addrlen!=0) *addrlen = alen;
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ServerSocket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ServerSocket.cc	(revision 8)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ServerSocket.h"
-
-#include "Socket.h"
-
-#include <unistd.h>
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::ServerSocket;
-using hu::varadiistvan::scpl::io::Acceptor;
-
-//------------------------------------------------------------------------------
-
-ServerSocket::ServerSocket(int domain, int type, Waiter* waiter, int protocol) :
-    Waitable(waiter, Socket::socket(domain, type, protocol))
-{
-    if (fd<0) setErrorCodeFromErrno();
-    else if (waiter!=0) setNonBlocking(fd);
-}
-
-//------------------------------------------------------------------------------
-
-ServerSocket::~ServerSocket()
-{
-    if (fd>=0) ::close(fd);
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerSocket::bind(const struct sockaddr* addr, size_t addrlen,
-                        bool reuseaddr)
-{
-    if (reuseaddr) {
-        int reuse = 1;
-        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse))<0) {
-            setErrorCodeFromErrno();
-            return false;
-        }
-    }
-
-    if (::bind(fd, addr, addrlen)<0) {
-        setErrorCodeFromErrno();
-        return false;
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerSocket::listen(int backlog)
-{
-    if (::listen(fd, backlog)<0) {
-        setErrorCodeFromErrno();
-        return false;
-    } else {
-        return true;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-int ServerSocket::accept(struct sockaddr* addr, size_t* addrlen)
-{
-    socklen_t alen = (addrlen==0) ? 0 : *addrlen;
-    int result = ::accept(fd, addr, (addrlen==0) ? 0 : &alen);
-    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
-        setErrorCodeFromErrno();
-    } else {
-        if (addrlen!=0) *addrlen = alen;
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ServerSocket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/ServerSocket.h	(revision 8)
@@ -0,0 +1,114 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "Waitable.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+struct sockaddr;
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Acceptor;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A socket in a server role. It can only bind to a new address,
+ * listen and accept connections. It cannot connect to other sockets
+ * and cannot be read or written.
+ */
+class ServerSocket : public Waitable
+{
+protected:
+    /**
+     * Construct the server socket.
+     */
+    ServerSocket(int domain, int type, Waiter* waiter = 0, int protocol = 0);
+
+public:
+    /**
+     * Destroy the server socket.
+     */
+    virtual ~ServerSocket();
+
+protected:
+    /**
+     * Bind the socket to the given address.
+     *
+     * @param reuseaddr if set to true, the SO_REUSEADDR socket option
+     * will be set.
+     *
+     * @return if the binding has succeeded. If it is false, the error
+     * code will be set accordingly.
+     */
+    bool bind(const struct sockaddr* addr, size_t addrlen,
+              bool reuseaddr = true);
+
+    /**
+     * Start listening on the socket.
+     *
+     * @return if the call has succeeded. If it is false, the error
+     * code will be set accordingly.
+     */
+    bool listen(int backlog = 5);
+
+    /**
+     * Accept a socket.
+     *
+     * @return the accepted socket. If may be -1, if the socket is
+     * non-blocking, and no connection is available yet, or if another
+     * error occured, in which case the error code will be set properly.
+     */
+    int accept(struct sockaddr* addr, size_t* addrlen);
+
+    friend class Acceptor;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/ServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/ServerSocket.h	(revision 8)
+++ 	(revision )
@@ -1,114 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "Waitable.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-struct sockaddr;
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Acceptor;
-
-//------------------------------------------------------------------------------
-
-/**
- * A socket in a server role. It can only bind to a new address,
- * listen and accept connections. It cannot connect to other sockets
- * and cannot be read or written.
- */
-class ServerSocket : public Waitable
-{
-protected:
-    /**
-     * Construct the server socket.
-     */
-    ServerSocket(int domain, int type, Waiter* waiter = 0, int protocol = 0);
-
-public:
-    /**
-     * Destroy the server socket.
-     */
-    virtual ~ServerSocket();
-
-protected:
-    /**
-     * Bind the socket to the given address.
-     *
-     * @param reuseaddr if set to true, the SO_REUSEADDR socket option
-     * will be set.
-     *
-     * @return if the binding has succeeded. If it is false, the error
-     * code will be set accordingly.
-     */
-    bool bind(const struct sockaddr* addr, size_t addrlen,
-              bool reuseaddr = true);
-
-    /**
-     * Start listening on the socket.
-     *
-     * @return if the call has succeeded. If it is false, the error
-     * code will be set accordingly.
-     */
-    bool listen(int backlog = 5);
-
-    /**
-     * Accept a socket.
-     *
-     * @return the accepted socket. If may be -1, if the socket is
-     * non-blocking, and no connection is available yet, or if another
-     * error occured, in which case the error code will be set properly.
-     */
-    int accept(struct sockaddr* addr, size_t* addrlen);
-
-    friend class Acceptor;
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_SERVERSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Socket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Socket.cc	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Socket.cc	(revision 8)
@@ -0,0 +1,60 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Socket.h"
+
+#include <unistd.h>
+#include <sys/socket.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Socket;
+
+//------------------------------------------------------------------------------
+
+int Socket::socket(int domain, int type, int protocol)
+{
+    return ::socket(domain, type, protocol);
+}
+
+//------------------------------------------------------------------------------
+
+Socket::~Socket()
+{
+    if (fd>=0) ::close(fd);
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Socket.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Socket.cc	(revision 8)
+++ 	(revision )
@@ -1,60 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Socket.h"
-
-#include <unistd.h>
-#include <sys/socket.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Socket;
-
-//------------------------------------------------------------------------------
-
-int Socket::socket(int domain, int type, int protocol)
-{
-    return ::socket(domain, type, protocol);
-}
-
-//------------------------------------------------------------------------------
-
-Socket::~Socket()
-{
-    if (fd>=0) ::close(fd);
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Socket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Socket.h	(revision 8)
+++ src/hu/varadiistvan/scpl/io/_posix/Socket.h	(revision 8)
@@ -0,0 +1,113 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
+//------------------------------------------------------------------------------
+
+#include "BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+struct sockaddr;
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffered, waitable socket implementation.
+ */
+class Socket : public BufferedStream
+{
+private:
+    /**
+     * Construct a socket with the given parameters.
+     */
+    static int socket(int domain, int type, int protocol);
+
+protected:
+    /**
+     * Construct the socket with the given parameters.
+     */
+    Socket(int domain, int type, Waiter* waiter = 0, int protocol = 0,
+           size_t readingCapacity = DEFAULT_CAPACITY,
+           size_t writingCapacity = DEFAULT_CAPACITY);
+
+    /**
+     * Construct the socket with the given file descriptor.
+     */
+    Socket(int fd, Waiter* waiter = 0,
+           size_t readingCapacity = DEFAULT_CAPACITY,
+           size_t writingCapacity = DEFAULT_CAPACITY);
+
+public:
+    /**
+     * Destroy the socket by closing the file descriptor.
+     */
+    virtual ~Socket();
+
+    friend class ServerSocket;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Socket::Socket(int domain, int type, Waiter* waiter, int protocol,
+                      size_t readingCapacity, size_t writingCapacity) :
+    BufferedStream(waiter, socket(domain, type, protocol),
+                     readingCapacity, writingCapacity)
+{
+    if (fd<0) setErrorCodeFromErrno();
+    else if (waiter!=0) setNonBlocking(fd);
+}
+
+//------------------------------------------------------------------------------
+
+inline Socket::Socket(int fd, Waiter* waiter,
+                      size_t readingCapacity, size_t writingCapacity) :
+    BufferedStream(waiter, fd, readingCapacity, writingCapacity)
+{
+    if (waiter!=0) setNonBlocking(fd);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Socket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Socket.h	(revision 8)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
-//------------------------------------------------------------------------------
-
-#include "BufferedStream.h"
-
-//------------------------------------------------------------------------------
-
-struct sockaddr;
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffered, waitable socket implementation.
- */
-class Socket : public BufferedStream
-{
-private:
-    /**
-     * Construct a socket with the given parameters.
-     */
-    static int socket(int domain, int type, int protocol);
-
-protected:
-    /**
-     * Construct the socket with the given parameters.
-     */
-    Socket(int domain, int type, Waiter* waiter = 0, int protocol = 0,
-           size_t readingCapacity = DEFAULT_CAPACITY,
-           size_t writingCapacity = DEFAULT_CAPACITY);
-
-    /**
-     * Construct the socket with the given file descriptor.
-     */
-    Socket(int fd, Waiter* waiter = 0,
-           size_t readingCapacity = DEFAULT_CAPACITY,
-           size_t writingCapacity = DEFAULT_CAPACITY);
-
-public:
-    /**
-     * Destroy the socket by closing the file descriptor.
-     */
-    virtual ~Socket();
-
-    friend class ServerSocket;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Socket::Socket(int domain, int type, Waiter* waiter, int protocol,
-                      size_t readingCapacity, size_t writingCapacity) :
-    BufferedStream(waiter, socket(domain, type, protocol),
-                     readingCapacity, writingCapacity)
-{
-    if (fd<0) setErrorCodeFromErrno();
-    else if (waiter!=0) setNonBlocking(fd);
-}
-
-//------------------------------------------------------------------------------
-
-inline Socket::Socket(int fd, Waiter* waiter,
-                      size_t readingCapacity, size_t writingCapacity) :
-    BufferedStream(waiter, fd, readingCapacity, writingCapacity)
-{
-    if (waiter!=0) setNonBlocking(fd);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_SOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/StreamBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/StreamBuffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/StreamBuffer.h	(revision 6)
@@ -0,0 +1,110 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "../Buffer.h"
+#include "../Failable.h"
+
+#include "BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for buffers used by a BufferedStream.
+ */
+class StreamBuffer : public Buffer, public FailableReference<StreamBuffer>
+{
+protected:
+    /**
+     * Our buffered stream.
+     */
+    BufferedStream& stream;
+
+protected:
+    /**
+     * Construct the buffer with the given waitable.
+     */
+    StreamBuffer(size_t capacity, BufferedStream* stream);
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    Failable& getFailable();
+
+    friend class FailableReference<StreamBuffer>;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
+    Buffer(capacity),
+    stream(*stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline const Failable& StreamBuffer::getFailable() const
+{
+    return stream;
+}
+
+//------------------------------------------------------------------------------
+
+inline Failable& StreamBuffer::getFailable()
+{
+    return stream;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/StreamBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/StreamBuffer.h	(revision 6)
+++ 	(revision )
@@ -1,110 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "../Buffer.h"
-#include "../Failable.h"
-
-#include "BufferedStream.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for buffers used by a BufferedStream.
- */
-class StreamBuffer : public Buffer, public FailableReference<StreamBuffer>
-{
-protected:
-    /**
-     * Our buffered stream.
-     */
-    BufferedStream& stream;
-
-protected:
-    /**
-     * Construct the buffer with the given waitable.
-     */
-    StreamBuffer(size_t capacity, BufferedStream* stream);
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    Failable& getFailable();
-
-    friend class FailableReference<StreamBuffer>;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
-    Buffer(capacity),
-    stream(*stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline const Failable& StreamBuffer::getFailable() const
-{
-    return stream;
-}
-
-//------------------------------------------------------------------------------
-
-inline Failable& StreamBuffer::getFailable()
-{
-    return stream;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_STREAMBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waitable.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waitable.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/Waitable.cc	(revision 6)
@@ -0,0 +1,71 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Waitable.h"
+
+#include "Waiter.h"
+
+#include <fcntl.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Waitable;
+
+//------------------------------------------------------------------------------
+
+void Waitable::setNonBlocking(int fd)
+{
+    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
+}
+
+//------------------------------------------------------------------------------
+
+Waitable::Waitable(Waiter* waiter, int fd, short events) :
+    waiter(waiter),
+    fd(fd),
+    events(events)
+{
+    if (waiter!=0) waiter->add(this);
+}
+
+//------------------------------------------------------------------------------
+
+Waitable::~Waitable()
+{
+    if (waiter!=0) waiter->remove(this);
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waitable.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waitable.cc	(revision 6)
+++ 	(revision )
@@ -1,71 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Waitable.h"
-
-#include "Waiter.h"
-
-#include <fcntl.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Waitable;
-
-//------------------------------------------------------------------------------
-
-void Waitable::setNonBlocking(int fd)
-{
-    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
-}
-
-//------------------------------------------------------------------------------
-
-Waitable::Waitable(Waiter* waiter, int fd, short events) :
-    waiter(waiter),
-    fd(fd),
-    events(events)
-{
-    if (waiter!=0) waiter->add(this);
-}
-
-//------------------------------------------------------------------------------
-
-Waitable::~Waitable()
-{
-    if (waiter!=0) waiter->remove(this);
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waitable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waitable.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/Waitable.h	(revision 6)
@@ -0,0 +1,161 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include <cerrno>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Waiter;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class of objects for which one can wait in a Waiter.
+ *
+ * It is basically a file descriptor.
+ */
+class Waitable : public Failable
+{
+public:
+    /**
+     * Set the given file descriptor to non-blocking.
+     */
+    static void setNonBlocking(int fd);
+
+protected:
+    /**
+     * The waiter this waitable belongs to, if any.
+     */
+    Waiter* waiter;
+
+    /**
+     * The file descriptor
+     */
+    int fd;
+
+    /**
+     * The events this waitable is interested in.
+     */
+    short events;
+
+protected:
+    /**
+     * Construct the waitable.
+     */
+    Waitable(Waiter* waiter, int fd = -1, short events = 0);
+
+public:
+    /**
+     * Destroy the waitable. It will be removed from the waiter.
+     */
+    virtual ~Waitable();
+
+    /**
+     * Get the waiter.
+     */
+    Waiter* getWaiter() const;
+
+    /**
+     * Determine if the waitable is ready or not, i.e. if there is no
+     * need to wait for it.
+     *
+     * It first checks the events. If they are 0, the waitable is
+     * ready. Then it calls isReady() and returns the result of that
+     * function.
+     */
+    bool ready();
+
+protected:
+    /**
+     * Indicate if the waitable is ready, i.e. there is no need to
+     * wait for it.
+     *
+     * Calling this function should not delete the ready
+     * indication. It should be deleted by actually processing the
+     * data.
+     */
+    virtual bool isReady() = 0;
+
+    /**
+     * Handle the given events.
+     */
+    virtual void handleEvents(short events) = 0;
+
+    /**
+     * Set the error code from errno.
+     */
+    void setErrorCodeFromErrno();
+
+    friend class Waiter;
+};
+
+//------------------------------------------------------------------------------
+// Inline defintions
+//------------------------------------------------------------------------------
+
+inline Waiter* Waitable::getWaiter() const
+{
+    return waiter;
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Waitable::ready()
+{
+    return (events==0) || isReady();
+}
+
+//------------------------------------------------------------------------------
+
+inline void Waitable::setErrorCodeFromErrno()
+{
+    setErrorCode(errno);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waitable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waitable.h	(revision 6)
+++ 	(revision )
@@ -1,161 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include <cerrno>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Waiter;
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class of objects for which one can wait in a Waiter.
- *
- * It is basically a file descriptor.
- */
-class Waitable : public Failable
-{
-public:
-    /**
-     * Set the given file descriptor to non-blocking.
-     */
-    static void setNonBlocking(int fd);
-
-protected:
-    /**
-     * The waiter this waitable belongs to, if any.
-     */
-    Waiter* waiter;
-
-    /**
-     * The file descriptor
-     */
-    int fd;
-
-    /**
-     * The events this waitable is interested in.
-     */
-    short events;
-
-protected:
-    /**
-     * Construct the waitable.
-     */
-    Waitable(Waiter* waiter, int fd = -1, short events = 0);
-
-public:
-    /**
-     * Destroy the waitable. It will be removed from the waiter.
-     */
-    virtual ~Waitable();
-
-    /**
-     * Get the waiter.
-     */
-    Waiter* getWaiter() const;
-
-    /**
-     * Determine if the waitable is ready or not, i.e. if there is no
-     * need to wait for it.
-     *
-     * It first checks the events. If they are 0, the waitable is
-     * ready. Then it calls isReady() and returns the result of that
-     * function.
-     */
-    bool ready();
-
-protected:
-    /**
-     * Indicate if the waitable is ready, i.e. there is no need to
-     * wait for it.
-     *
-     * Calling this function should not delete the ready
-     * indication. It should be deleted by actually processing the
-     * data.
-     */
-    virtual bool isReady() = 0;
-
-    /**
-     * Handle the given events.
-     */
-    virtual void handleEvents(short events) = 0;
-
-    /**
-     * Set the error code from errno.
-     */
-    void setErrorCodeFromErrno();
-
-    friend class Waiter;
-};
-
-//------------------------------------------------------------------------------
-// Inline defintions
-//------------------------------------------------------------------------------
-
-inline Waiter* Waitable::getWaiter() const
-{
-    return waiter;
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Waitable::ready()
-{
-    return (events==0) || isReady();
-}
-
-//------------------------------------------------------------------------------
-
-inline void Waitable::setErrorCodeFromErrno()
-{
-    setErrorCode(errno);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.cc	(revision 7)
+++ src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.cc	(revision 7)
@@ -0,0 +1,126 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "WaitableEvent.h"
+
+#include <poll.h>
+#include <unistd.h>
+
+#include <sys/eventfd.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::WaitableEvent;
+
+//------------------------------------------------------------------------------
+
+WaitableEvent::WaitableEvent(Waiter* waiter) :
+    Waitable(waiter, eventfd(0, (waiter==0) ? 0 : EFD_NONBLOCK), POLLIN),
+    fired(false)
+{
+    if (fd<0) {
+        setErrorCodeFromErrno();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+WaitableEvent::~WaitableEvent()
+{
+    close(fd);
+}
+
+//------------------------------------------------------------------------------
+
+void WaitableEvent::fire()
+{
+    static const uint64_t one = 1;
+    if (write(fd, &one, sizeof(one))<0) {
+        if (errno!=EAGAIN) {
+            setErrorCodeFromErrno();
+        }
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool WaitableEvent::check()
+{
+    if (doCheck()) {
+        fired = false;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool WaitableEvent::isReady()
+{
+    return fired;
+}
+
+//------------------------------------------------------------------------------
+
+void WaitableEvent::handleEvents(short events)
+{
+    if ((events&POLLIN)==POLLIN) {
+        doCheck();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool WaitableEvent::doCheck(bool fromHandleEvents)
+{
+    if (failed()) return false;
+    if (!fromHandleEvents && fired) return true;
+
+    uint64_t value = 0;
+    if (read(fd, &value, sizeof(value))<0) {
+        if (errno!=EAGAIN) {
+            setErrorCodeFromErrno();
+        }
+    } else {
+        fired = fired || value>0;
+    }
+
+    return fired;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.cc	(revision 7)
+++ 	(revision )
@@ -1,126 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "WaitableEvent.h"
-
-#include <poll.h>
-#include <unistd.h>
-
-#include <sys/eventfd.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::WaitableEvent;
-
-//------------------------------------------------------------------------------
-
-WaitableEvent::WaitableEvent(Waiter* waiter) :
-    Waitable(waiter, eventfd(0, (waiter==0) ? 0 : EFD_NONBLOCK), POLLIN),
-    fired(false)
-{
-    if (fd<0) {
-        setErrorCodeFromErrno();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-WaitableEvent::~WaitableEvent()
-{
-    close(fd);
-}
-
-//------------------------------------------------------------------------------
-
-void WaitableEvent::fire()
-{
-    static const uint64_t one = 1;
-    if (write(fd, &one, sizeof(one))<0) {
-        if (errno!=EAGAIN) {
-            setErrorCodeFromErrno();
-        }
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool WaitableEvent::check()
-{
-    if (doCheck()) {
-        fired = false;
-        return true;
-    } else {
-        return false;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool WaitableEvent::isReady()
-{
-    return fired;
-}
-
-//------------------------------------------------------------------------------
-
-void WaitableEvent::handleEvents(short events)
-{
-    if ((events&POLLIN)==POLLIN) {
-        doCheck();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool WaitableEvent::doCheck(bool fromHandleEvents)
-{
-    if (failed()) return false;
-    if (!fromHandleEvents && fired) return true;
-
-    uint64_t value = 0;
-    if (read(fd, &value, sizeof(value))<0) {
-        if (errno!=EAGAIN) {
-            setErrorCodeFromErrno();
-        }
-    } else {
-        fired = fired || value>0;
-    }
-
-    return fired;
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.h	(revision 7)
+++ src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.h	(revision 7)
@@ -0,0 +1,107 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
+//------------------------------------------------------------------------------
+
+#include "Waitable.h"
+
+#include "../Failable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * An event on which one can wait with a waiter.
+ */
+class WaitableEvent : public Waitable
+{
+private:
+    /**
+     * Indicate if the event is fired.
+     */
+    volatile bool fired;
+
+public:
+    /**
+     * Construct the event.
+     */
+    WaitableEvent(Waiter* waiter = 0);
+
+    /**
+     * Destroy the event.
+     */
+    virtual ~WaitableEvent();
+
+    /**
+     * Fire the event.
+     */
+    void fire();
+
+    /**
+     * Check if the event is fired or not. If so, the fired status
+     * will be cleared.
+     */
+    bool check();
+
+protected:
+    /**
+     * Check if the event is fired or not.
+     */
+    virtual bool isReady();
+
+    /**
+     * Handle the given events.
+     */
+    virtual void handleEvents(short events);
+
+private:
+    /**
+     * Perform the real check. If we already know that we are fired,
+     * just return true. Otherwise try to read from the event fd.
+     */
+    bool doCheck(bool fromHandleEvents = false);
+};
+
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WaitableEvent.h	(revision 7)
+++ 	(revision )
@@ -1,107 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
-//------------------------------------------------------------------------------
-
-#include "Waitable.h"
-
-#include "../Failable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * An event on which one can wait with a waiter.
- */
-class WaitableEvent : public Waitable
-{
-private:
-    /**
-     * Indicate if the event is fired.
-     */
-    volatile bool fired;
-
-public:
-    /**
-     * Construct the event.
-     */
-    WaitableEvent(Waiter* waiter = 0);
-
-    /**
-     * Destroy the event.
-     */
-    virtual ~WaitableEvent();
-
-    /**
-     * Fire the event.
-     */
-    void fire();
-
-    /**
-     * Check if the event is fired or not. If so, the fired status
-     * will be cleared.
-     */
-    bool check();
-
-protected:
-    /**
-     * Check if the event is fired or not.
-     */
-    virtual bool isReady();
-
-    /**
-     * Handle the given events.
-     */
-    virtual void handleEvents(short events);
-
-private:
-    /**
-     * Perform the real check. If we already know that we are fired,
-     * just return true. Otherwise try to read from the event fd.
-     */
-    bool doCheck(bool fromHandleEvents = false);
-};
-
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITABLEEVENT_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waiter.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waiter.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/Waiter.cc	(revision 6)
@@ -0,0 +1,153 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Waiter.h"
+
+#include "Waitable.h"
+
+#include <cassert>
+#include <cerrno>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Waiter;
+
+//------------------------------------------------------------------------------
+
+inline bool Waiter::hasReady() const
+{
+    for(waitables_t::const_iterator i = waitables.begin(); i!=waitables.end();
+        ++i)
+    {
+        Waitable* waitable = i->second;
+        if (waitable->ready()) {
+            return true;
+        }
+    }
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t Waiter::setupPollFDs(pollfd* pollFDs)
+{
+    size_t numValid = 0;
+
+    for(waitables_t::const_iterator i = waitables.begin(); i!=waitables.end();
+        ++i)
+    {
+        Waitable* waitable = i->second;
+        if (waitable->events==0) continue;
+
+        pollfd& pollFD = pollFDs[numValid++];
+
+        pollFD.fd = waitable->fd;
+        pollFD.events = waitable->events;
+        pollFD.revents = 0;
+    }
+
+    return numValid;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Waiter::processPollFDs(const pollfd* pollFDs, size_t size)
+{
+    for(size_t i = 0; i<size; ++i) {
+        const pollfd& pollFD = pollFDs[i];
+        if (pollFD.revents!=0) {
+            waitables_t::iterator j = waitables.find(pollFD.fd);
+            assert(j!=waitables.end());
+            Waitable* waitable = j->second;
+            waitable->handleEvents(pollFD.revents);
+        }
+    }
+}
+
+//------------------------------------------------------------------------------
+
+Waiter::~Waiter()
+{
+    for(waitables_t::iterator i = waitables.begin(); i!=waitables.end(); ++i)
+    {
+        Waitable* waitable = i->second;
+        waitable->waiter = 0;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool Waiter::wait(int timeout)
+{
+    if (hasReady()) return true;
+
+    pollfd pollFDs[numWaitables];
+    size_t numValid = setupPollFDs(pollFDs);
+
+    int result = poll(pollFDs, numValid, timeout);
+
+    if (result<0) {
+        setErrorCode(errno);
+        return false;
+    } else if (result>0) {
+        processPollFDs(pollFDs, numValid);
+    }
+
+    return hasReady();
+}
+
+//------------------------------------------------------------------------------
+
+void Waiter::add(Waitable* waitable)
+{
+    assert(waitable->fd>=0);
+    assert(waitables.find(waitable->fd)==waitables.end());
+    waitables[waitable->fd] = waitable;
+    ++numWaitables;
+}
+
+//------------------------------------------------------------------------------
+
+void Waiter::remove(Waitable* waitable)
+{
+    assert(numWaitables>0);
+    assert(waitables.find(waitable->fd)!=waitables.end());
+    assert(waitables[waitable->fd]==waitable);
+    waitables.erase(waitable->fd);
+    --numWaitables;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waiter.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waiter.cc	(revision 6)
+++ 	(revision )
@@ -1,153 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Waiter.h"
-
-#include "Waitable.h"
-
-#include <cassert>
-#include <cerrno>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Waiter;
-
-//------------------------------------------------------------------------------
-
-inline bool Waiter::hasReady() const
-{
-    for(waitables_t::const_iterator i = waitables.begin(); i!=waitables.end();
-        ++i)
-    {
-        Waitable* waitable = i->second;
-        if (waitable->ready()) {
-            return true;
-        }
-    }
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t Waiter::setupPollFDs(pollfd* pollFDs)
-{
-    size_t numValid = 0;
-
-    for(waitables_t::const_iterator i = waitables.begin(); i!=waitables.end();
-        ++i)
-    {
-        Waitable* waitable = i->second;
-        if (waitable->events==0) continue;
-
-        pollfd& pollFD = pollFDs[numValid++];
-
-        pollFD.fd = waitable->fd;
-        pollFD.events = waitable->events;
-        pollFD.revents = 0;
-    }
-
-    return numValid;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Waiter::processPollFDs(const pollfd* pollFDs, size_t size)
-{
-    for(size_t i = 0; i<size; ++i) {
-        const pollfd& pollFD = pollFDs[i];
-        if (pollFD.revents!=0) {
-            waitables_t::iterator j = waitables.find(pollFD.fd);
-            assert(j!=waitables.end());
-            Waitable* waitable = j->second;
-            waitable->handleEvents(pollFD.revents);
-        }
-    }
-}
-
-//------------------------------------------------------------------------------
-
-Waiter::~Waiter()
-{
-    for(waitables_t::iterator i = waitables.begin(); i!=waitables.end(); ++i)
-    {
-        Waitable* waitable = i->second;
-        waitable->waiter = 0;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool Waiter::wait(int timeout)
-{
-    if (hasReady()) return true;
-
-    pollfd pollFDs[numWaitables];
-    size_t numValid = setupPollFDs(pollFDs);
-
-    int result = poll(pollFDs, numValid, timeout);
-
-    if (result<0) {
-        setErrorCode(errno);
-        return false;
-    } else if (result>0) {
-        processPollFDs(pollFDs, numValid);
-    }
-
-    return hasReady();
-}
-
-//------------------------------------------------------------------------------
-
-void Waiter::add(Waitable* waitable)
-{
-    assert(waitable->fd>=0);
-    assert(waitables.find(waitable->fd)==waitables.end());
-    waitables[waitable->fd] = waitable;
-    ++numWaitables;
-}
-
-//------------------------------------------------------------------------------
-
-void Waiter::remove(Waitable* waitable)
-{
-    assert(numWaitables>0);
-    assert(waitables.find(waitable->fd)!=waitables.end());
-    assert(waitables[waitable->fd]==waitable);
-    waitables.erase(waitable->fd);
-    --numWaitables;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waiter.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/Waiter.h	(revision 6)
@@ -0,0 +1,154 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include <map>
+
+#include <cstdlib>
+
+#include <poll.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Waitable;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Class that can be used to register waitable objects and then wait
+ * for them.
+ */
+class Waiter : public Failable
+{
+private:
+    /**
+     * Type for the set of waitables.
+     */
+    typedef std::map<int, Waitable*> waitables_t;
+
+    /**
+     * The set of waitables belonging to this waiter.
+     */
+    waitables_t waitables;
+
+    /**
+     * The number of waitables.
+     */
+    size_t numWaitables;
+
+public:
+    /**
+     * Construct the waiter.
+     */
+    Waiter();
+
+    /**
+     * Destroy the waiter. All waitables that still exists will be
+     * modified to point to no waiter.
+     */
+    ~Waiter();
+
+    /**
+     * Wait for any if the waitables to become ready or until a
+     * timeout expires.
+     *
+     * If any of the waitables are ready, the function returns immediately.
+     *
+     * @return true if any of the waitables has become ready, false if
+     * the timeout occurs.
+     */
+    bool wait(int timeout = -1);
+
+protected:
+    /**
+     * Add a waitable.
+     */
+    void add(Waitable* waitable);
+
+    /**
+     * Remove a waitable.
+     */
+    void remove(Waitable* waitable);
+
+private:
+    /**
+     * Determine if any of the waitables is ready.
+     */
+    bool hasReady() const;
+
+    /**
+     * Fill the given array of poll descriptors with those file
+     * descriptors that wait for an event.
+     *
+     * @param pollFDs the file descriptor array to fill. It should
+     * contain at least as many elements as the number of waitables.
+     *
+     * @return the number of valid poll file descriptors.
+     */
+    size_t setupPollFDs(pollfd* pollFDs);
+
+    /**
+     * Process the given array of poll descriptors. For each
+     * descriptor, if its events are not 0, the handleEvents()
+     * function of the corresponding waitable is called.
+     */
+    void processPollFDs(const pollfd* pollFDs, size_t size);
+
+    friend class Waitable;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Waiter::Waiter() :
+    numWaitables(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/Waiter.h	(revision 6)
+++ 	(revision )
@@ -1,154 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include <map>
-
-#include <cstdlib>
-
-#include <poll.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Waitable;
-
-//------------------------------------------------------------------------------
-
-/**
- * Class that can be used to register waitable objects and then wait
- * for them.
- */
-class Waiter : public Failable
-{
-private:
-    /**
-     * Type for the set of waitables.
-     */
-    typedef std::map<int, Waitable*> waitables_t;
-
-    /**
-     * The set of waitables belonging to this waiter.
-     */
-    waitables_t waitables;
-
-    /**
-     * The number of waitables.
-     */
-    size_t numWaitables;
-
-public:
-    /**
-     * Construct the waiter.
-     */
-    Waiter();
-
-    /**
-     * Destroy the waiter. All waitables that still exists will be
-     * modified to point to no waiter.
-     */
-    ~Waiter();
-
-    /**
-     * Wait for any if the waitables to become ready or until a
-     * timeout expires.
-     *
-     * If any of the waitables are ready, the function returns immediately.
-     *
-     * @return true if any of the waitables has become ready, false if
-     * the timeout occurs.
-     */
-    bool wait(int timeout = -1);
-
-protected:
-    /**
-     * Add a waitable.
-     */
-    void add(Waitable* waitable);
-
-    /**
-     * Remove a waitable.
-     */
-    void remove(Waitable* waitable);
-
-private:
-    /**
-     * Determine if any of the waitables is ready.
-     */
-    bool hasReady() const;
-
-    /**
-     * Fill the given array of poll descriptors with those file
-     * descriptors that wait for an event.
-     *
-     * @param pollFDs the file descriptor array to fill. It should
-     * contain at least as many elements as the number of waitables.
-     *
-     * @return the number of valid poll file descriptors.
-     */
-    size_t setupPollFDs(pollfd* pollFDs);
-
-    /**
-     * Process the given array of poll descriptors. For each
-     * descriptor, if its events are not 0, the handleEvents()
-     * function of the corresponding waitable is called.
-     */
-    void processPollFDs(const pollfd* pollFDs, size_t size);
-
-    friend class Waitable;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Waiter::Waiter() :
-    numWaitables(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WAITER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.cc	(revision 6)
@@ -0,0 +1,84 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "WritingBuffer.h"
+
+#include "BufferedStream.h"
+
+#include <poll.h>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::WritingBuffer;
+
+//------------------------------------------------------------------------------
+
+void WritingBuffer::reset()
+{
+    Buffer::reset();
+    offset = 0;
+    stream.events &= ~POLLOUT;
+}
+
+//------------------------------------------------------------------------------
+
+bool WritingBuffer::write()
+{
+    if (failed()) return false;
+
+    if (getLength()<=offset) {
+        reset();
+        return true;
+    }
+
+    size_t toWrite = getLength() - offset;
+
+    ssize_t result = stream.write(getData() + offset, toWrite);
+    if (result<static_cast<ssize_t>(toWrite)) {
+        if (result<0 && stream.failed()) {
+            stream.events &= ~POLLOUT;
+        } else {
+            stream.events |= POLLOUT;
+            if (result>0) offset += result;
+        }
+        return false;
+    } else {
+        reset();
+        return true;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.cc	(revision 6)
+++ 	(revision )
@@ -1,84 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "WritingBuffer.h"
-
-#include "BufferedStream.h"
-
-#include <poll.h>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::WritingBuffer;
-
-//------------------------------------------------------------------------------
-
-void WritingBuffer::reset()
-{
-    Buffer::reset();
-    offset = 0;
-    stream.events &= ~POLLOUT;
-}
-
-//------------------------------------------------------------------------------
-
-bool WritingBuffer::write()
-{
-    if (failed()) return false;
-
-    if (getLength()<=offset) {
-        reset();
-        return true;
-    }
-
-    size_t toWrite = getLength() - offset;
-
-    ssize_t result = stream.write(getData() + offset, toWrite);
-    if (result<static_cast<ssize_t>(toWrite)) {
-        if (result<0 && stream.failed()) {
-            stream.events &= ~POLLOUT;
-        } else {
-            stream.events |= POLLOUT;
-            if (result>0) offset += result;
-        }
-        return false;
-    } else {
-        reset();
-        return true;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.h	(revision 6)
@@ -0,0 +1,113 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "StreamBuffer.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for writing.
+ *
+ * The data to write should be stored in the buffer. Then write()
+ * should be called. If it returns true, it indicates that all data
+ * has been written. In that case the buffer is automatically emptied.
+ */
+class WritingBuffer : public StreamBuffer
+{
+private:
+    /**
+     * The offset of the next byte to write.
+     */
+    size_t offset;
+
+protected:
+    /**
+     * Construct the buffer.
+     */
+    WritingBuffer(size_t capacity, BufferedStream* stream);
+
+public:
+    /**
+     * Reset the buffer. It resets the offset too.
+     */
+    void reset();
+
+    /**
+     * Write the contents of the buffer using the associated buffered
+     * stream.
+     *
+     * If the buffer is empty, the function returns indicating
+     * success.
+     *
+     * If the complete remaining contents could be written, it also indicates
+     * success, and the buffer is reset, ready to be used again.
+     *
+     * If not everything can be written and the write operation
+     * indicates that it would block, this function returns failure
+     * after the stream has been set up  to handle the corresponding
+     * poll events.
+     *
+     * Otherwise, if the writing operation fails for some other
+     * reason, the buffer's error code is set to the error's code and
+     * false is returned.
+     */
+    bool write();
+
+    friend class BufferedStream;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline WritingBuffer::WritingBuffer(size_t capacity, BufferedStream* stream):
+    StreamBuffer(capacity, stream),
+    offset(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_posix/WritingBuffer.h	(revision 6)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "StreamBuffer.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for writing.
- *
- * The data to write should be stored in the buffer. Then write()
- * should be called. If it returns true, it indicates that all data
- * has been written. In that case the buffer is automatically emptied.
- */
-class WritingBuffer : public StreamBuffer
-{
-private:
-    /**
-     * The offset of the next byte to write.
-     */
-    size_t offset;
-
-protected:
-    /**
-     * Construct the buffer.
-     */
-    WritingBuffer(size_t capacity, BufferedStream* stream);
-
-public:
-    /**
-     * Reset the buffer. It resets the offset too.
-     */
-    void reset();
-
-    /**
-     * Write the contents of the buffer using the associated buffered
-     * stream.
-     *
-     * If the buffer is empty, the function returns indicating
-     * success.
-     *
-     * If the complete remaining contents could be written, it also indicates
-     * success, and the buffer is reset, ready to be used again.
-     *
-     * If not everything can be written and the write operation
-     * indicates that it would block, this function returns failure
-     * after the stream has been set up  to handle the corresponding
-     * poll events.
-     *
-     * Otherwise, if the writing operation fails for some other
-     * reason, the buffer's error code is set to the error's code and
-     * false is returned.
-     */
-    bool write();
-
-    friend class BufferedStream;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline WritingBuffer::WritingBuffer(size_t capacity, BufferedStream* stream):
-    StreamBuffer(capacity, stream),
-    offset(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_POSIX_WRITINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.copyright	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/.copyright	(revision 6)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/_win32/.copyright
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.copyright	(revision 6)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/hu/varadiistvan/scpl/io/_win32/.guardns
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.guardns	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/.guardns	(revision 6)
@@ -0,0 +1,1 @@
+win32
Index: src/hu/varadiistvan/scpl/io/_win32/.guardns
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.guardns	(revision 6)
+++ 	(revision )
@@ -1,1 +1,0 @@
-win32
Index: src/hu/varadiistvan/scpl/io/_win32/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.namespace	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/.namespace	(revision 6)
@@ -0,0 +1,4 @@
+hu
+varadiistvan
+scpl
+io
Index: src/hu/varadiistvan/scpl/io/_win32/.namespace
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.namespace	(revision 6)
+++ 	(revision )
@@ -1,4 +1,0 @@
-hu
-varadiistvan
-scpl
-io
Index: src/hu/varadiistvan/scpl/io/_win32/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.srcmessage	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/.srcmessage	(revision 6)
@@ -0,0 +1,1 @@
+// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/_win32/.srcmessage
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/.srcmessage	(revision 6)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of VSCPL, a simple cross-platform utility library
Index: src/hu/varadiistvan/scpl/io/_win32/BufferedStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/BufferedStream.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/BufferedStream.cc	(revision 9)
@@ -0,0 +1,112 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "BufferedStream.h"
+
+#include "ReadingBuffer.h"
+#include "WritingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::BufferedStream;
+
+//------------------------------------------------------------------------------
+
+BufferedStream::BufferedStream(Waiter* waiter, HANDLE handle,
+                               size_t readingCapacity, size_t writingCapacity) :
+    Overlappable(waiter, handle),
+    readingBuffer( (readingCapacity==0) ? 0 :
+                   new ReadingBuffer(readingCapacity, this)),
+    writingBuffer( (writingCapacity==0) ? 0 :
+                   new WritingBuffer(writingCapacity, this))
+{
+}
+
+//------------------------------------------------------------------------------
+
+BufferedStream::~BufferedStream()
+{
+    delete writingBuffer;
+    delete readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+ssize_t BufferedStream::read(void* dest, size_t length, Overlapped* overlapped)
+{
+    DWORD numRead = 0;
+    if (overlapped!=0) overlapped->reset();
+    bool result = ReadFile(handle, dest, length,
+                           (overlapped==0) ? &numRead : 0,
+                           (overlapped==0) ? 0 : overlapped->get());
+    DWORD error = GetLastError();
+    if (!result &&
+        (overlapped==0 ||
+         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
+    {
+        setErrorCode(error);
+        return -1;
+    } else if (overlapped==0 || overlapped->getResult(numRead, handle)) {
+        return numRead;
+    } else {
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool BufferedStream::write(const void* src, size_t length,
+                           Overlapped* overlapped)
+{
+    if (overlapped!=0) overlapped->reset();
+    bool result = WriteFile(handle, src, length, 0,
+                            (overlapped==0) ? 0 : overlapped->get());
+    DWORD error = GetLastError();
+    if (!result &&
+        (overlapped==0 ||
+         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
+    {
+        setErrorCode(error);
+        return false;
+    } else if (overlapped==0) {
+        return result;
+    } else {
+        DWORD numWritten = 0;
+        return overlapped->getResult(numWritten, handle);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/BufferedStream.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/BufferedStream.cc	(revision 9)
+++ 	(revision )
@@ -1,112 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "BufferedStream.h"
-
-#include "ReadingBuffer.h"
-#include "WritingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::BufferedStream;
-
-//------------------------------------------------------------------------------
-
-BufferedStream::BufferedStream(Waiter* waiter, HANDLE handle,
-                               size_t readingCapacity, size_t writingCapacity) :
-    Overlappable(waiter, handle),
-    readingBuffer( (readingCapacity==0) ? 0 :
-                   new ReadingBuffer(readingCapacity, this)),
-    writingBuffer( (writingCapacity==0) ? 0 :
-                   new WritingBuffer(writingCapacity, this))
-{
-}
-
-//------------------------------------------------------------------------------
-
-BufferedStream::~BufferedStream()
-{
-    delete writingBuffer;
-    delete readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-ssize_t BufferedStream::read(void* dest, size_t length, Overlapped* overlapped)
-{
-    DWORD numRead = 0;
-    if (overlapped!=0) overlapped->reset();
-    bool result = ReadFile(handle, dest, length,
-                           (overlapped==0) ? &numRead : 0,
-                           (overlapped==0) ? 0 : overlapped->get());
-    DWORD error = GetLastError();
-    if (!result &&
-        (overlapped==0 ||
-         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
-    {
-        setErrorCode(error);
-        return -1;
-    } else if (overlapped==0 || overlapped->getResult(numRead, handle)) {
-        return numRead;
-    } else {
-        return -1;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool BufferedStream::write(const void* src, size_t length,
-                           Overlapped* overlapped)
-{
-    if (overlapped!=0) overlapped->reset();
-    bool result = WriteFile(handle, src, length, 0,
-                            (overlapped==0) ? 0 : overlapped->get());
-    DWORD error = GetLastError();
-    if (!result &&
-        (overlapped==0 ||
-         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
-    {
-        setErrorCode(error);
-        return false;
-    } else if (overlapped==0) {
-        return result;
-    } else {
-        DWORD numWritten = 0;
-        return overlapped->getResult(numWritten, handle);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/BufferedStream.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/BufferedStream.h	(revision 9)
@@ -0,0 +1,152 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
+//------------------------------------------------------------------------------
+
+#include "Overlappable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class ReadingBuffer;
+class WritingBuffer;
+class Overlapped;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffered stream.
+ *
+ * It wraps a HANDLE which can be read and/or written with ReadFile or
+ * WriteFile, respectively.
+ */
+class BufferedStream : public Overlappable
+{
+public:
+    /**
+     * The default capacity.
+     */
+    static const size_t DEFAULT_CAPACITY = 4096;
+
+private:
+    /**
+     * The reading buffer. It may be 0, if no reading buffer is
+     * associated with this waitable.
+     */
+    ReadingBuffer* readingBuffer;
+
+    /**
+     * The writing buffer. It may be 0, if no writing buffer is
+     * associated with this waitable.
+     */
+    WritingBuffer* writingBuffer;
+
+protected:
+    /**
+     * Construct the buffered stream.
+     */
+    BufferedStream(Waiter* waiter = 0, HANDLE handle = 0,
+                   size_t readingCapacity = DEFAULT_CAPACITY,
+                   size_t writingCapacity = DEFAULT_CAPACITY);
+
+public:
+    /**
+     * Destroy the stream.
+     */
+    virtual ~BufferedStream();
+
+    /**
+     * Get the reference of the reading buffer. Note, that it can be a
+     * 0 reference, if the stream has no reading buffer.
+     */
+    ReadingBuffer& getReadingBuffer();
+
+    /**
+     * Get the reference of the writing buffer. Note, that it can be a
+     * 0 reference, if the stream has no writing buffer.
+     */
+    WritingBuffer& getWritingBuffer();
+
+protected:
+    /**
+     * Read using the handle at most the given number of bytes into
+     * the given buffer.
+     *
+     * @return the number of bytes read. If 0, it indicates the end of
+     * the file or connection. If negative, it means either a failure,
+     * or the fact that the operation cannot be completed at this time.
+     */
+    ssize_t read(void* dest, size_t length, Overlapped* overlapped);
+
+    /**
+     * Write using the handle the given number of bytes from the given
+     * buffer.
+     *
+     * @return whether the writing succeeded. If false, it is either a
+     * failure, or an inidication of the fact that the operation could
+     * not be completed.
+     */
+    bool write(const void* src, size_t length, Overlapped* overlapped);
+
+    friend class ReadingBuffer;
+    friend class WritingBuffer;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ReadingBuffer& BufferedStream::getReadingBuffer()
+{
+    return *readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+inline WritingBuffer& BufferedStream::getWritingBuffer()
+{
+    return *writingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/BufferedStream.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/BufferedStream.h	(revision 9)
+++ 	(revision )
@@ -1,152 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
-//------------------------------------------------------------------------------
-
-#include "Overlappable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class ReadingBuffer;
-class WritingBuffer;
-class Overlapped;
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffered stream.
- *
- * It wraps a HANDLE which can be read and/or written with ReadFile or
- * WriteFile, respectively.
- */
-class BufferedStream : public Overlappable
-{
-public:
-    /**
-     * The default capacity.
-     */
-    static const size_t DEFAULT_CAPACITY = 4096;
-
-private:
-    /**
-     * The reading buffer. It may be 0, if no reading buffer is
-     * associated with this waitable.
-     */
-    ReadingBuffer* readingBuffer;
-
-    /**
-     * The writing buffer. It may be 0, if no writing buffer is
-     * associated with this waitable.
-     */
-    WritingBuffer* writingBuffer;
-
-protected:
-    /**
-     * Construct the buffered stream.
-     */
-    BufferedStream(Waiter* waiter = 0, HANDLE handle = 0,
-                   size_t readingCapacity = DEFAULT_CAPACITY,
-                   size_t writingCapacity = DEFAULT_CAPACITY);
-
-public:
-    /**
-     * Destroy the stream.
-     */
-    virtual ~BufferedStream();
-
-    /**
-     * Get the reference of the reading buffer. Note, that it can be a
-     * 0 reference, if the stream has no reading buffer.
-     */
-    ReadingBuffer& getReadingBuffer();
-
-    /**
-     * Get the reference of the writing buffer. Note, that it can be a
-     * 0 reference, if the stream has no writing buffer.
-     */
-    WritingBuffer& getWritingBuffer();
-
-protected:
-    /**
-     * Read using the handle at most the given number of bytes into
-     * the given buffer.
-     *
-     * @return the number of bytes read. If 0, it indicates the end of
-     * the file or connection. If negative, it means either a failure,
-     * or the fact that the operation cannot be completed at this time.
-     */
-    ssize_t read(void* dest, size_t length, Overlapped* overlapped);
-
-    /**
-     * Write using the handle the given number of bytes from the given
-     * buffer.
-     *
-     * @return whether the writing succeeded. If false, it is either a
-     * failure, or an inidication of the fact that the operation could
-     * not be completed.
-     */
-    bool write(const void* src, size_t length, Overlapped* overlapped);
-
-    friend class ReadingBuffer;
-    friend class WritingBuffer;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ReadingBuffer& BufferedStream::getReadingBuffer()
-{
-    return *readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-inline WritingBuffer& BufferedStream::getWritingBuffer()
-{
-    return *writingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_BUFFEREDSTREAM_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Completer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Completer.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/Completer.h	(revision 9)
@@ -0,0 +1,219 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include "Overlapped.h"
+#include "Overlappable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for objects that handle the completion of some
+ * operation. They are associated with an Overlappable, and if that
+ * overlappable is non-blocking (i.e. has a waiter), an Overlapped
+ * object is created and stored in this object.
+ */
+class Completer : public FailableReference<Completer>
+{
+protected:
+    /**
+     * The overlappable object this completer belongs to.
+     */
+    Overlappable& overlappable;
+
+    /**
+     * The overlapped object.
+     */
+    Overlapped* overlapped;
+
+protected:
+    /**
+     * Construct the completer for the given Overlappable.
+     */
+    Completer(Overlappable* overlappable);
+
+    /**
+     * Destroy the completer.
+     */
+    virtual ~Completer();
+
+    /**
+     * Add the overlapped object (if any) to the given waiter.
+     */
+    void addTo(Waiter* waiter);
+
+    /**
+     * Remove the overlapped object (if any) from the waiter it is
+     * associated with.
+     */
+    void removeFromWaiter();
+
+    /**
+     * Determine if there is an overlapped object and it is being
+     * waited for.
+     */
+    bool isWaited() const;
+
+    /**
+     * Get the result of the overlapped operation, if any.
+     *
+     * @see Overlapped::getResult
+     */
+    bool getResult(DWORD& size);
+
+    /**
+     * Check whether we are waiting for an overlapped result and if
+     * so, return that.
+     *
+     * @param result will contain the result to return if we are
+     * waiting for an overlapped result.
+     *
+     * @return whether we are waiting for an overlapped result
+     */
+    bool checkWaitedResult(bool& result);
+
+    /**
+     * Handle the given result coming from an overlapped object.
+     */
+    virtual void handleWaitedResult(DWORD size) = 0;
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    Failable& getFailable();
+
+    friend class FailableReference<Completer>;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Completer::Completer(Overlappable* overlappable) :
+    overlappable(*overlappable),
+    overlapped((overlappable->waiter==0) ? 0 : new Overlapped(*overlappable))
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Completer::~Completer()
+{
+    delete overlapped;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Completer::addTo(Waiter* waiter)
+{
+    if (overlapped!=0 && waiter!=0) overlapped->addTo(*waiter);
+}
+
+//------------------------------------------------------------------------------
+
+inline void Completer::removeFromWaiter()
+{
+    if (overlapped!=0) overlapped->removeFromWaiter();
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Completer::isWaited() const
+{
+    return overlapped!=0 && overlapped->isWaited();
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Completer::getResult(DWORD& size)
+{
+    return overlapped!=0 && overlapped->getResult(size, overlappable.handle);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Completer::checkWaitedResult(bool& result)
+{
+    if (!isWaited()) {
+        return false;
+    }
+
+    DWORD size = 0;
+    result = getResult(size);
+
+    if (result) {
+        removeFromWaiter();
+        handleWaitedResult(size);
+    } else if (overlappable.failed()) {
+        removeFromWaiter();
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+inline const Failable& Completer::getFailable() const
+{
+    return overlappable;
+}
+
+//------------------------------------------------------------------------------
+
+inline Failable& Completer::getFailable()
+{
+    return overlappable;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Completer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Completer.h	(revision 9)
+++ 	(revision )
@@ -1,219 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include "Overlapped.h"
-#include "Overlappable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for objects that handle the completion of some
- * operation. They are associated with an Overlappable, and if that
- * overlappable is non-blocking (i.e. has a waiter), an Overlapped
- * object is created and stored in this object.
- */
-class Completer : public FailableReference<Completer>
-{
-protected:
-    /**
-     * The overlappable object this completer belongs to.
-     */
-    Overlappable& overlappable;
-
-    /**
-     * The overlapped object.
-     */
-    Overlapped* overlapped;
-
-protected:
-    /**
-     * Construct the completer for the given Overlappable.
-     */
-    Completer(Overlappable* overlappable);
-
-    /**
-     * Destroy the completer.
-     */
-    virtual ~Completer();
-
-    /**
-     * Add the overlapped object (if any) to the given waiter.
-     */
-    void addTo(Waiter* waiter);
-
-    /**
-     * Remove the overlapped object (if any) from the waiter it is
-     * associated with.
-     */
-    void removeFromWaiter();
-
-    /**
-     * Determine if there is an overlapped object and it is being
-     * waited for.
-     */
-    bool isWaited() const;
-
-    /**
-     * Get the result of the overlapped operation, if any.
-     *
-     * @see Overlapped::getResult
-     */
-    bool getResult(DWORD& size);
-
-    /**
-     * Check whether we are waiting for an overlapped result and if
-     * so, return that.
-     *
-     * @param result will contain the result to return if we are
-     * waiting for an overlapped result.
-     *
-     * @return whether we are waiting for an overlapped result
-     */
-    bool checkWaitedResult(bool& result);
-
-    /**
-     * Handle the given result coming from an overlapped object.
-     */
-    virtual void handleWaitedResult(DWORD size) = 0;
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    Failable& getFailable();
-
-    friend class FailableReference<Completer>;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Completer::Completer(Overlappable* overlappable) :
-    overlappable(*overlappable),
-    overlapped((overlappable->waiter==0) ? 0 : new Overlapped(*overlappable))
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Completer::~Completer()
-{
-    delete overlapped;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Completer::addTo(Waiter* waiter)
-{
-    if (overlapped!=0 && waiter!=0) overlapped->addTo(*waiter);
-}
-
-//------------------------------------------------------------------------------
-
-inline void Completer::removeFromWaiter()
-{
-    if (overlapped!=0) overlapped->removeFromWaiter();
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Completer::isWaited() const
-{
-    return overlapped!=0 && overlapped->isWaited();
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Completer::getResult(DWORD& size)
-{
-    return overlapped!=0 && overlapped->getResult(size, overlappable.handle);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Completer::checkWaitedResult(bool& result)
-{
-    if (!isWaited()) {
-        return false;
-    }
-
-    DWORD size = 0;
-    result = getResult(size);
-
-    if (result) {
-        removeFromWaiter();
-        handleWaitedResult(size);
-    } else if (overlappable.failed()) {
-        removeFromWaiter();
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-inline const Failable& Completer::getFailable() const
-{
-    return overlappable;
-}
-
-//------------------------------------------------------------------------------
-
-inline Failable& Completer::getFailable()
-{
-    return overlappable;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_COMPLETER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Event.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Event.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/Event.cc	(revision 6)
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Event.h"
+
+#include "Waiter.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Event;
+
+//------------------------------------------------------------------------------
+
+bool Event::isFired() const
+{
+    DWORD result = WaitForSingleObject(handle, (waiter==0) ? INFINITE : 0);
+    if (result==WAIT_FAILED) {
+        eventFailable.setErrorCode(GetLastError());
+        return false;
+    } else if (result==WAIT_OBJECT_0) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void Event::addTo(Waiter& w)
+{
+    removeFromWaiter();
+    w.add(this);
+    waiter = &w;
+}
+
+//------------------------------------------------------------------------------
+
+void Event::removeFromWaiter()
+{
+    if (waiter!=0) {
+        waiter->remove(this);
+        waiter = 0;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Event.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Event.cc	(revision 6)
+++ 	(revision )
@@ -1,79 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Event.h"
-
-#include "Waiter.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Event;
-
-//------------------------------------------------------------------------------
-
-bool Event::isFired() const
-{
-    DWORD result = WaitForSingleObject(handle, (waiter==0) ? INFINITE : 0);
-    if (result==WAIT_FAILED) {
-        eventFailable.setErrorCode(GetLastError());
-        return false;
-    } else if (result==WAIT_OBJECT_0) {
-        return true;
-    } else {
-        return false;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void Event::addTo(Waiter& w)
-{
-    removeFromWaiter();
-    w.add(this);
-    waiter = &w;
-}
-
-//------------------------------------------------------------------------------
-
-void Event::removeFromWaiter()
-{
-    if (waiter!=0) {
-        waiter->remove(this);
-        waiter = 0;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Event.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Event.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/Event.h	(revision 6)
@@ -0,0 +1,209 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
+//------------------------------------------------------------------------------
+
+#include "EventFailable.h"
+
+#include <windows.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Waiter;
+
+/**
+ * Wrapper for an event.
+ */
+class Event
+{
+private:
+    /**
+     * The object receiving the failure codes.
+     */
+    EventFailable& eventFailable;
+
+    /**
+     * The handle of the event.
+     */
+    HANDLE handle;
+
+    /**
+     * The object waiting for the event.
+     */
+    Waiter* waiter;
+
+public:
+    /**
+     * Construct the event.
+     */
+    Event(EventFailable& eventFailable);
+
+    /**
+     * Destroy the event. It will be removed from the waiter if it is
+     * in one.
+     */
+    ~Event();
+
+    /**
+     * Get the handle of the event.
+     */
+    HANDLE getHandle() const;
+
+    /**
+     * Get the waiter.
+     */
+    Waiter* getWaiter() const;
+
+    /**
+     * Register the event with the given waiter. If it is already
+     * registered with a waiter, it will be removed from that.
+     */
+    void addTo(Waiter& w);
+
+    /**
+     * Remove the object from the waiter it is registered with.
+     */
+    void removeFromWaiter();
+
+    /**
+     * Determine if the event is being waited for, i.e. it is
+     * associated with a waiter.
+     */
+    bool isWaited() const;
+
+    /**
+     * Set the event.
+     */
+    void fire();
+
+    /**
+     * Determine if the event is fired or not.
+     */
+    bool isFired() const;
+
+    /**
+     * Clear the event.
+     *
+     * @return if clearing succeeded.
+     */
+    bool clear();
+
+protected:
+    /**
+     * Set the error code on the failable object.
+     */
+    void setErrorCode(errorCode_t errorCode);
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Event::Event(EventFailable& eventFailable) :
+    eventFailable(eventFailable),
+    handle(CreateEvent(0, true, false, 0)),
+    waiter(0)
+{
+    if (handle==0) eventFailable.setErrorCode(GetLastError());
+}
+
+//------------------------------------------------------------------------------
+
+inline Event::~Event()
+{
+    removeFromWaiter();
+    CloseHandle(handle);
+}
+
+//------------------------------------------------------------------------------
+
+inline HANDLE Event::getHandle() const
+{
+    return handle;
+}
+
+//------------------------------------------------------------------------------
+
+inline Waiter* Event::getWaiter() const
+{
+    return waiter;
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Event::isWaited() const
+{
+    return waiter!=0;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Event::fire()
+{
+    if (!SetEvent(handle)) {
+        eventFailable.setErrorCode(GetLastError());
+    }
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Event::clear()
+{
+    if (!ResetEvent(handle)) {
+        eventFailable.setErrorCode(GetLastError());
+        return false;
+    } else {
+        return true;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+inline void Event::setErrorCode(errorCode_t errorCode)
+{
+    eventFailable.setErrorCode(errorCode);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Event.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Event.h	(revision 6)
+++ 	(revision )
@@ -1,209 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
-//------------------------------------------------------------------------------
-
-#include "EventFailable.h"
-
-#include <windows.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Waiter;
-
-/**
- * Wrapper for an event.
- */
-class Event
-{
-private:
-    /**
-     * The object receiving the failure codes.
-     */
-    EventFailable& eventFailable;
-
-    /**
-     * The handle of the event.
-     */
-    HANDLE handle;
-
-    /**
-     * The object waiting for the event.
-     */
-    Waiter* waiter;
-
-public:
-    /**
-     * Construct the event.
-     */
-    Event(EventFailable& eventFailable);
-
-    /**
-     * Destroy the event. It will be removed from the waiter if it is
-     * in one.
-     */
-    ~Event();
-
-    /**
-     * Get the handle of the event.
-     */
-    HANDLE getHandle() const;
-
-    /**
-     * Get the waiter.
-     */
-    Waiter* getWaiter() const;
-
-    /**
-     * Register the event with the given waiter. If it is already
-     * registered with a waiter, it will be removed from that.
-     */
-    void addTo(Waiter& w);
-
-    /**
-     * Remove the object from the waiter it is registered with.
-     */
-    void removeFromWaiter();
-
-    /**
-     * Determine if the event is being waited for, i.e. it is
-     * associated with a waiter.
-     */
-    bool isWaited() const;
-
-    /**
-     * Set the event.
-     */
-    void fire();
-
-    /**
-     * Determine if the event is fired or not.
-     */
-    bool isFired() const;
-
-    /**
-     * Clear the event.
-     *
-     * @return if clearing succeeded.
-     */
-    bool clear();
-
-protected:
-    /**
-     * Set the error code on the failable object.
-     */
-    void setErrorCode(errorCode_t errorCode);
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Event::Event(EventFailable& eventFailable) :
-    eventFailable(eventFailable),
-    handle(CreateEvent(0, true, false, 0)),
-    waiter(0)
-{
-    if (handle==0) eventFailable.setErrorCode(GetLastError());
-}
-
-//------------------------------------------------------------------------------
-
-inline Event::~Event()
-{
-    removeFromWaiter();
-    CloseHandle(handle);
-}
-
-//------------------------------------------------------------------------------
-
-inline HANDLE Event::getHandle() const
-{
-    return handle;
-}
-
-//------------------------------------------------------------------------------
-
-inline Waiter* Event::getWaiter() const
-{
-    return waiter;
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Event::isWaited() const
-{
-    return waiter!=0;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Event::fire()
-{
-    if (!SetEvent(handle)) {
-        eventFailable.setErrorCode(GetLastError());
-    }
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Event::clear()
-{
-    if (!ResetEvent(handle)) {
-        eventFailable.setErrorCode(GetLastError());
-        return false;
-    } else {
-        return true;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-inline void Event::setErrorCode(errorCode_t errorCode)
-{
-    eventFailable.setErrorCode(errorCode);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_EVENT_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/EventFailable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/EventFailable.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/EventFailable.h	(revision 6)
@@ -0,0 +1,67 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Event;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A special subclass of Failable, the instances of which can be given
+ * as a Failable target object to events. If some operation on an
+ * event fails, the error code will be set on such an instance,
+ * associated with the event.
+ */
+class EventFailable : public Failable
+{
+    friend class Event;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/EventFailable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/EventFailable.h	(revision 6)
+++ 	(revision )
@@ -1,67 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Event;
-
-//------------------------------------------------------------------------------
-
-/**
- * A special subclass of Failable, the instances of which can be given
- * as a Failable target object to events. If some operation on an
- * event fails, the error code will be set on such an instance,
- * associated with the event.
- */
-class EventFailable : public Failable
-{
-    friend class Event;
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_EVENTFAILABLE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.cc	(revision 9)
@@ -0,0 +1,86 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalAcceptor.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalAcceptor;
+
+//------------------------------------------------------------------------------
+
+LocalAcceptor::LocalAcceptor(LocalServerSocketBase* socket, const char* name) :
+    Completer(socket),
+    accepted(false)
+{
+    LocalSocket::setupPath(path, name);
+}
+
+//------------------------------------------------------------------------------
+
+bool LocalAcceptor::accept()
+{
+    if (failed()) return false;
+    if (accepted) return true;
+
+    bool result = false;
+    if (checkWaitedResult(result)) {
+        return result;
+    }
+
+    LocalServerSocketBase& socket = getServerSocket();
+    if (!socket.createNamedPipe(path)) {
+        return false;
+    }
+
+    result = socket.connectNamedPipe(overlapped);
+    if (result) {
+        accepted = true;
+    } else if (!socket.failed()) {
+        addTo(socket.waiter);
+    }
+
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+void LocalAcceptor::handleWaitedResult(DWORD /*size*/)
+{
+    accepted = true;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.cc	(revision 9)
+++ 	(revision )
@@ -1,86 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalAcceptor.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalAcceptor;
-
-//------------------------------------------------------------------------------
-
-LocalAcceptor::LocalAcceptor(LocalServerSocketBase* socket, const char* name) :
-    Completer(socket),
-    accepted(false)
-{
-    LocalSocket::setupPath(path, name);
-}
-
-//------------------------------------------------------------------------------
-
-bool LocalAcceptor::accept()
-{
-    if (failed()) return false;
-    if (accepted) return true;
-
-    bool result = false;
-    if (checkWaitedResult(result)) {
-        return result;
-    }
-
-    LocalServerSocketBase& socket = getServerSocket();
-    if (!socket.createNamedPipe(path)) {
-        return false;
-    }
-
-    result = socket.connectNamedPipe(overlapped);
-    if (result) {
-        accepted = true;
-    } else if (!socket.failed()) {
-        addTo(socket.waiter);
-    }
-
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-void LocalAcceptor::handleWaitedResult(DWORD /*size*/)
-{
-    accepted = true;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.h	(revision 9)
@@ -0,0 +1,160 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
+//------------------------------------------------------------------------------
+
+#include "Completer.h"
+
+#include "LocalServerSocketBase.h"
+#include "LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Instances of this class are used to accept connection requests to a
+ * local server socket, i.e. named pipe.
+ */
+class LocalAcceptor : public Completer
+{
+private:
+    /**
+     * The path of the pipe to accept.
+     */
+    char path[256];
+
+    /**
+     * Indicate if the connection has been accepted.
+     */
+    bool accepted;
+
+protected:
+    /**
+     * Construct the acceptor.
+     */
+    LocalAcceptor(LocalServerSocketBase* socket, const char* name);
+
+    /**
+     * Get the socket.
+     *
+     * It returns the overlappable from the Completer part, knowing
+     * that it must be a LocalServerSocketBase.
+     */
+    LocalServerSocketBase& getServerSocket() const;
+
+public:
+    /**
+     * Try to accept a connection.
+     *
+     * If one is already accepted, but not retrieved yet, return true.
+     *
+     * If a new connection becomes immediately available, return true.
+     *
+     * If a new connection is not yet available, returns false.
+     *
+     * If some error occurs, the acceptor is marked failed and false
+     * is returned.
+     */
+    bool accept();
+
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the given one.
+     */
+    LocalSocket* getSocket(Waiter* waiter,
+                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+    /**
+     * Get the local socket accepted last. If no socket was accepted,
+     * return 0. The local socket's waiter will be the same as that of
+     * the associated server socket.
+     */
+    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
+                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
+
+
+protected:
+    /**
+     * Set the indicator of an accepted connection to true.
+     *
+     * @see Completer::handleWaitedResult
+     */
+    virtual void handleWaitedResult(DWORD size);
+
+    friend class LocalServerSocket;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalServerSocketBase& LocalAcceptor::getServerSocket() const
+{
+    return static_cast<LocalServerSocketBase&>(overlappable);
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalSocket* LocalAcceptor::getSocket(Waiter* waiter,
+                                             size_t readingCapacity,
+                                             size_t writingCapacity)
+{
+    if (!accepted) return 0;
+
+    LocalSocket* s = new LocalSocket(waiter, overlappable.releaseHandle(),
+                                     readingCapacity, writingCapacity);
+    accepted = false;
+    return s;
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalSocket* LocalAcceptor::getSocket(size_t readingCapacity,
+                                             size_t writingCapacity)
+{
+    return getSocket(overlappable.getWaiter(),
+                     readingCapacity, writingCapacity);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalAcceptor.h	(revision 9)
+++ 	(revision )
@@ -1,160 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
-//------------------------------------------------------------------------------
-
-#include "Completer.h"
-
-#include "LocalServerSocketBase.h"
-#include "LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Instances of this class are used to accept connection requests to a
- * local server socket, i.e. named pipe.
- */
-class LocalAcceptor : public Completer
-{
-private:
-    /**
-     * The path of the pipe to accept.
-     */
-    char path[256];
-
-    /**
-     * Indicate if the connection has been accepted.
-     */
-    bool accepted;
-
-protected:
-    /**
-     * Construct the acceptor.
-     */
-    LocalAcceptor(LocalServerSocketBase* socket, const char* name);
-
-    /**
-     * Get the socket.
-     *
-     * It returns the overlappable from the Completer part, knowing
-     * that it must be a LocalServerSocketBase.
-     */
-    LocalServerSocketBase& getServerSocket() const;
-
-public:
-    /**
-     * Try to accept a connection.
-     *
-     * If one is already accepted, but not retrieved yet, return true.
-     *
-     * If a new connection becomes immediately available, return true.
-     *
-     * If a new connection is not yet available, returns false.
-     *
-     * If some error occurs, the acceptor is marked failed and false
-     * is returned.
-     */
-    bool accept();
-
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the given one.
-     */
-    LocalSocket* getSocket(Waiter* waiter,
-                           size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-    /**
-     * Get the local socket accepted last. If no socket was accepted,
-     * return 0. The local socket's waiter will be the same as that of
-     * the associated server socket.
-     */
-    LocalSocket* getSocket(size_t readingCapacity = LocalSocket::DEFAULT_CAPACITY,
-                           size_t writingCapacity = LocalSocket::DEFAULT_CAPACITY);
-
-
-protected:
-    /**
-     * Set the indicator of an accepted connection to true.
-     *
-     * @see Completer::handleWaitedResult
-     */
-    virtual void handleWaitedResult(DWORD size);
-
-    friend class LocalServerSocket;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalServerSocketBase& LocalAcceptor::getServerSocket() const
-{
-    return static_cast<LocalServerSocketBase&>(overlappable);
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalSocket* LocalAcceptor::getSocket(Waiter* waiter,
-                                             size_t readingCapacity,
-                                             size_t writingCapacity)
-{
-    if (!accepted) return 0;
-
-    LocalSocket* s = new LocalSocket(waiter, overlappable.releaseHandle(),
-                                     readingCapacity, writingCapacity);
-    accepted = false;
-    return s;
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalSocket* LocalAcceptor::getSocket(size_t readingCapacity,
-                                             size_t writingCapacity)
-{
-    return getSocket(overlappable.getWaiter(),
-                     readingCapacity, writingCapacity);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALACCEPTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalClientSocket.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalClientSocket.h	(revision 9)
@@ -0,0 +1,100 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A client socket that connects to a named server socket locally,
+ * i.e. a named pipe.
+ *
+ * The server socket's name should be given. The name will be used as
+ * described for LocalServerSocket.
+ */
+class LocalClientSocket : public LocalSocket
+{
+private:
+    /**
+     * The local connector.
+     */
+    LocalConnector connector;
+
+public:
+    /**
+     * Construct the client socket with the given name.
+     */
+    LocalClientSocket(const char* name, Waiter* waiter = 0,
+                      size_t readingCapacity = DEFAULT_CAPACITY,
+                      size_t writingCapacity = DEFAULT_CAPACITY);
+
+    /**
+     * Get the connector.
+     */
+    LocalConnector& getConnector();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalClientSocket::LocalClientSocket(const char* name, Waiter* waiter,
+                                            size_t readingCapacity,
+                                            size_t writingCapacity) :
+    LocalSocket(waiter, 0, readingCapacity, writingCapacity),
+    connector(this, name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalConnector& LocalClientSocket::getConnector()
+{
+    return connector;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalClientSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalClientSocket.h	(revision 9)
+++ 	(revision )
@@ -1,100 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A client socket that connects to a named server socket locally,
- * i.e. a named pipe.
- *
- * The server socket's name should be given. The name will be used as
- * described for LocalServerSocket.
- */
-class LocalClientSocket : public LocalSocket
-{
-private:
-    /**
-     * The local connector.
-     */
-    LocalConnector connector;
-
-public:
-    /**
-     * Construct the client socket with the given name.
-     */
-    LocalClientSocket(const char* name, Waiter* waiter = 0,
-                      size_t readingCapacity = DEFAULT_CAPACITY,
-                      size_t writingCapacity = DEFAULT_CAPACITY);
-
-    /**
-     * Get the connector.
-     */
-    LocalConnector& getConnector();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalClientSocket::LocalClientSocket(const char* name, Waiter* waiter,
-                                            size_t readingCapacity,
-                                            size_t writingCapacity) :
-    LocalSocket(waiter, 0, readingCapacity, writingCapacity),
-    connector(this, name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalConnector& LocalClientSocket::getConnector()
-{
-    return connector;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCLIENTSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalConnector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalConnector.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalConnector.cc	(revision 9)
@@ -0,0 +1,58 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalConnector.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalConnector;
+
+//------------------------------------------------------------------------------
+
+bool LocalConnector::connect()
+{
+    if (connected) return true;
+    if (failed()) return false;
+
+    if (socket.connect(path)) {
+        connected = true;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalConnector.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalConnector.cc	(revision 9)
+++ 	(revision )
@@ -1,58 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalConnector.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalConnector;
-
-//------------------------------------------------------------------------------
-
-bool LocalConnector::connect()
-{
-    if (connected) return true;
-    if (failed()) return false;
-
-    if (socket.connect(path)) {
-        connected = true;
-        return true;
-    } else {
-        return false;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalConnector.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalConnector.h	(revision 9)
@@ -0,0 +1,138 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
+//------------------------------------------------------------------------------
+
+#include "Completer.h"
+
+#include "LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A connector that connects to a local server socket (i.e. named
+ * pipe).
+ */
+class LocalConnector : public FailableReference<LocalConnector>
+{
+private:
+    /**
+     * The local socket to connect on behalf of which we connect (it should
+     * actually be a LocalClientSocket).
+     */
+    LocalSocket& socket;
+
+    /**
+     * The path of the pipe to connect to.
+     */
+    char path[256];
+
+    /**
+     * Indicate if we are connected.
+     */
+    bool connected;
+
+protected:
+    /**
+     * Construct the connector.
+     */
+    LocalConnector(LocalSocket* socket, const char* name);
+
+public:
+    /**
+     * Connect to an address properly set up.
+     *
+     * If the connection succeeds immediately, it indicates success.
+     *
+     * If the connection does not succeed, because it would block, it
+     * sets up the socket to wait for the connection to succeed, and
+     * returns failure.
+     *
+     * If the connection fails for another reason, the error code is
+     * set, and false is returned.
+     */
+    bool connect();
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    Failable& getFailable();
+
+    friend class FailableReference<LocalConnector>;
+    friend class LocalClientSocket;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalConnector::LocalConnector(LocalSocket* socket, const char* name) :
+    socket(*socket),
+    connected(false)
+{
+    LocalSocket::setupPath(path, name);
+}
+
+//------------------------------------------------------------------------------
+
+inline const Failable& LocalConnector::getFailable() const
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+inline Failable& LocalConnector::getFailable()
+{
+    return socket;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalConnector.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalConnector.h	(revision 9)
+++ 	(revision )
@@ -1,138 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
-//------------------------------------------------------------------------------
-
-#include "Completer.h"
-
-#include "LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A connector that connects to a local server socket (i.e. named
- * pipe).
- */
-class LocalConnector : public FailableReference<LocalConnector>
-{
-private:
-    /**
-     * The local socket to connect on behalf of which we connect (it should
-     * actually be a LocalClientSocket).
-     */
-    LocalSocket& socket;
-
-    /**
-     * The path of the pipe to connect to.
-     */
-    char path[256];
-
-    /**
-     * Indicate if we are connected.
-     */
-    bool connected;
-
-protected:
-    /**
-     * Construct the connector.
-     */
-    LocalConnector(LocalSocket* socket, const char* name);
-
-public:
-    /**
-     * Connect to an address properly set up.
-     *
-     * If the connection succeeds immediately, it indicates success.
-     *
-     * If the connection does not succeed, because it would block, it
-     * sets up the socket to wait for the connection to succeed, and
-     * returns failure.
-     *
-     * If the connection fails for another reason, the error code is
-     * set, and false is returned.
-     */
-    bool connect();
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    Failable& getFailable();
-
-    friend class FailableReference<LocalConnector>;
-    friend class LocalClientSocket;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalConnector::LocalConnector(LocalSocket* socket, const char* name) :
-    socket(*socket),
-    connected(false)
-{
-    LocalSocket::setupPath(path, name);
-}
-
-//------------------------------------------------------------------------------
-
-inline const Failable& LocalConnector::getFailable() const
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-inline Failable& LocalConnector::getFailable()
-{
-    return socket;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALCONNECTOR_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocket.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalServerSocket.h	(revision 9)
@@ -0,0 +1,97 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "LocalServerSocketBase.h"
+
+#include "LocalAcceptor.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A server socket that works locally, i.e. a named pipe.
+ *
+ * It is identified by a name that should be unique for a user. The
+ * actual pipe will be created with the name \\.\pipe\<name>.
+ */
+class LocalServerSocket : public LocalServerSocketBase
+{
+private:
+    /**
+     * The acceptor to use.
+     */
+    LocalAcceptor acceptor;
+
+public:
+    /**
+     * Construct the socket.
+     */
+    LocalServerSocket(const char* name, Waiter* waiter = 0);
+
+    /**
+     * Get the acceptor.
+     */
+    LocalAcceptor& getAcceptor();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalServerSocket::LocalServerSocket(const char* name, Waiter* waiter) :
+    LocalServerSocketBase(waiter),
+    acceptor(this, name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalAcceptor& LocalServerSocket::getAcceptor()
+{
+    return acceptor;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocket.h	(revision 9)
+++ 	(revision )
@@ -1,97 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "LocalServerSocketBase.h"
-
-#include "LocalAcceptor.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A server socket that works locally, i.e. a named pipe.
- *
- * It is identified by a name that should be unique for a user. The
- * actual pipe will be created with the name \\.\pipe\<name>.
- */
-class LocalServerSocket : public LocalServerSocketBase
-{
-private:
-    /**
-     * The acceptor to use.
-     */
-    LocalAcceptor acceptor;
-
-public:
-    /**
-     * Construct the socket.
-     */
-    LocalServerSocket(const char* name, Waiter* waiter = 0);
-
-    /**
-     * Get the acceptor.
-     */
-    LocalAcceptor& getAcceptor();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalServerSocket::LocalServerSocket(const char* name, Waiter* waiter) :
-    LocalServerSocketBase(waiter),
-    acceptor(this, name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalAcceptor& LocalServerSocket::getAcceptor()
-{
-    return acceptor;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.cc	(revision 14)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.cc	(revision 14)
@@ -0,0 +1,84 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "LocalServerSocketBase.h"
+
+#include "LocalSocket.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::LocalServerSocketBase;
+
+//------------------------------------------------------------------------------
+
+bool LocalServerSocketBase::createNamedPipe(const char* path)
+{
+    handle = CreateNamedPipe(path, PIPE_ACCESS_DUPLEX |
+                             ((waiter==0) ? 0 : FILE_FLAG_OVERLAPPED),
+                             PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
+                             PIPE_UNLIMITED_INSTANCES,
+                             BufferedStream::DEFAULT_CAPACITY,
+                             BufferedStream::DEFAULT_CAPACITY,
+                             0, 0);
+    if (handle==INVALID_HANDLE_VALUE) {
+        setErrorCode(GetLastError());
+    }
+    return handle!=0;
+}
+
+//------------------------------------------------------------------------------
+
+bool LocalServerSocketBase::connectNamedPipe(Overlapped* overlapped)
+{
+    if (overlapped!=0) overlapped->reset();
+    bool result = ConnectNamedPipe(handle,
+                                   (overlapped==0) ? 0 : overlapped->get());
+    DWORD error = GetLastError();
+    if (!result &&
+        (overlapped==0 ||
+         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
+    {
+        setErrorCode(error);
+        return false;
+    } else if (overlapped==0) {
+        return result;
+    } else {
+        DWORD dummy = 0;
+        return overlapped->getResult(dummy, handle);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.cc	(revision 14)
+++ 	(revision )
@@ -1,84 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "LocalServerSocketBase.h"
-
-#include "LocalSocket.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::LocalServerSocketBase;
-
-//------------------------------------------------------------------------------
-
-bool LocalServerSocketBase::createNamedPipe(const char* path)
-{
-    handle = CreateNamedPipe(path, PIPE_ACCESS_DUPLEX |
-                             ((waiter==0) ? 0 : FILE_FLAG_OVERLAPPED),
-                             PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
-                             PIPE_UNLIMITED_INSTANCES,
-                             BufferedStream::DEFAULT_CAPACITY,
-                             BufferedStream::DEFAULT_CAPACITY,
-                             0, 0);
-    if (handle==INVALID_HANDLE_VALUE) {
-        setErrorCode(GetLastError());
-    }
-    return handle!=0;
-}
-
-//------------------------------------------------------------------------------
-
-bool LocalServerSocketBase::connectNamedPipe(Overlapped* overlapped)
-{
-    if (overlapped!=0) overlapped->reset();
-    bool result = ConnectNamedPipe(handle,
-                                   (overlapped==0) ? 0 : overlapped->get());
-    DWORD error = GetLastError();
-    if (!result &&
-        (overlapped==0 ||
-         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
-    {
-        setErrorCode(error);
-        return false;
-    } else if (overlapped==0) {
-        return result;
-    } else {
-        DWORD dummy = 0;
-        return overlapped->getResult(dummy, handle);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.h	(revision 9)
@@ -0,0 +1,100 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
+//------------------------------------------------------------------------------
+
+#include "Overlappable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Overlapped;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for a local server socket. This is here only to allow
+ * for a more efficient implementation of LocalAcceptor.
+ */
+class LocalServerSocketBase : public Overlappable
+{
+protected:
+    /**
+     * Construct the server socket base.
+     */
+    LocalServerSocketBase(Waiter* waiter);
+
+    /**
+     * Create a new named pipe with the proper settings. The handle of
+     * this object will be set to the created handle.
+     *
+     * @param path the path of the pipe to create. It should be the
+     * final path, not the user-given name.
+     *
+     * @return whether the pipe could be created
+     */
+    bool createNamedPipe(const char* path);
+
+    /**
+     * Connect the named pipe with the current handle of this object.
+     *
+     * @return whether the connection succeeded. If not, it may be a
+     * failure, which is then indicated, or it may be an overlapped
+     * operation which needs to wait.
+     */
+    bool connectNamedPipe(Overlapped* overlapped);
+
+    friend class LocalAcceptor;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline LocalServerSocketBase::LocalServerSocketBase(Waiter* waiter) :
+    Overlappable(waiter)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalServerSocketBase.h	(revision 9)
+++ 	(revision )
@@ -1,100 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
-//------------------------------------------------------------------------------
-
-#include "Overlappable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Overlapped;
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for a local server socket. This is here only to allow
- * for a more efficient implementation of LocalAcceptor.
- */
-class LocalServerSocketBase : public Overlappable
-{
-protected:
-    /**
-     * Construct the server socket base.
-     */
-    LocalServerSocketBase(Waiter* waiter);
-
-    /**
-     * Create a new named pipe with the proper settings. The handle of
-     * this object will be set to the created handle.
-     *
-     * @param path the path of the pipe to create. It should be the
-     * final path, not the user-given name.
-     *
-     * @return whether the pipe could be created
-     */
-    bool createNamedPipe(const char* path);
-
-    /**
-     * Connect the named pipe with the current handle of this object.
-     *
-     * @return whether the connection succeeded. If not, it may be a
-     * failure, which is then indicated, or it may be an overlapped
-     * operation which needs to wait.
-     */
-    bool connectNamedPipe(Overlapped* overlapped);
-
-    friend class LocalAcceptor;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline LocalServerSocketBase::LocalServerSocketBase(Waiter* waiter) :
-    Overlappable(waiter)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSERVERSOCKETBASE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalSocket.h	(revision 14)
+++ src/hu/varadiistvan/scpl/io/_win32/LocalSocket.h	(revision 14)
@@ -0,0 +1,121 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
+//------------------------------------------------------------------------------
+
+#include "BufferedStream.h"
+
+#include "Overlapped.h"
+
+#include <cstdio>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Basically a different name for a buffered stream.
+ */
+class LocalSocket : public BufferedStream
+{
+public:
+    /**
+     * Create a concrete pipe path from the given user-specified name.
+     *
+     * @param dest the destination buffer, which should be at least
+     * 256 bytes long.
+     */
+    static void setupPath(char* dest, const char* name);
+
+protected:
+    /**
+     * Construct the local socket
+     */
+    LocalSocket(Waiter* waiter = 0, HANDLE handle = 0,
+                size_t readingCapacity = DEFAULT_CAPACITY,
+                size_t writingCapacity = DEFAULT_CAPACITY);
+
+
+protected:
+    /**
+     * Connect the client socket to the server.
+     */
+    bool connect(const char* path);
+
+    friend class LocalAcceptor;
+    friend class LocalConnector;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline void LocalSocket::setupPath(char* dest, const char* name)
+{
+    snprintf(dest, 256, "\\\\.\\pipe\\%s", name);
+}
+
+//------------------------------------------------------------------------------
+
+inline LocalSocket::LocalSocket(Waiter* waiter, HANDLE handle,
+                                size_t readingCapacity, size_t writingCapacity):
+    BufferedStream(waiter, handle, readingCapacity, writingCapacity)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline bool LocalSocket::connect(const char* path)
+{
+    handle = CreateFile(path, GENERIC_READ|GENERIC_WRITE,
+                        0, 0, OPEN_EXISTING,
+                        FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, 0);
+
+    if (handle==INVALID_HANDLE_VALUE) {
+        setErrorCode(GetLastError());
+    }
+
+    return handle!=INVALID_HANDLE_VALUE;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/LocalSocket.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/LocalSocket.h	(revision 14)
+++ 	(revision )
@@ -1,121 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
-//------------------------------------------------------------------------------
-
-#include "BufferedStream.h"
-
-#include "Overlapped.h"
-
-#include <cstdio>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Basically a different name for a buffered stream.
- */
-class LocalSocket : public BufferedStream
-{
-public:
-    /**
-     * Create a concrete pipe path from the given user-specified name.
-     *
-     * @param dest the destination buffer, which should be at least
-     * 256 bytes long.
-     */
-    static void setupPath(char* dest, const char* name);
-
-protected:
-    /**
-     * Construct the local socket
-     */
-    LocalSocket(Waiter* waiter = 0, HANDLE handle = 0,
-                size_t readingCapacity = DEFAULT_CAPACITY,
-                size_t writingCapacity = DEFAULT_CAPACITY);
-
-
-protected:
-    /**
-     * Connect the client socket to the server.
-     */
-    bool connect(const char* path);
-
-    friend class LocalAcceptor;
-    friend class LocalConnector;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline void LocalSocket::setupPath(char* dest, const char* name)
-{
-    snprintf(dest, 256, "\\\\.\\pipe\\%s", name);
-}
-
-//------------------------------------------------------------------------------
-
-inline LocalSocket::LocalSocket(Waiter* waiter, HANDLE handle,
-                                size_t readingCapacity, size_t writingCapacity):
-    BufferedStream(waiter, handle, readingCapacity, writingCapacity)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline bool LocalSocket::connect(const char* path)
-{
-    handle = CreateFile(path, GENERIC_READ|GENERIC_WRITE,
-                        0, 0, OPEN_EXISTING,
-                        FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, 0);
-
-    if (handle==INVALID_HANDLE_VALUE) {
-        setErrorCode(GetLastError());
-    }
-
-    return handle!=INVALID_HANDLE_VALUE;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_LOCALSOCKET_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Makefile.am	(revision 25)
+++ src/hu/varadiistvan/scpl/io/_win32/Makefile.am	(revision 25)
@@ -0,0 +1,36 @@
+AM_CPPFLAGS = -I$(top_builddir)/src
+
+SUBDIRS=
+
+noinst_LTLIBRARIES=libvscpl_io_win32.la
+
+libvscpl_io_win32_la_SOURCES=\
+        Event.cc                \
+        Overlapped.cc           \
+        Waiter.cc               \
+        BufferedStream.cc       \
+        ReadingBuffer.cc        \
+        WritingBuffer.cc        \
+        LocalConnector.cc       \
+        LocalAcceptor.cc        \
+        LocalServerSocketBase.cc
+
+include_vscpl_io_win32dir=$(includedir)/hu/varadiistvan/scpl/io/_win32
+include_vscpl_io_win32_HEADERS=\
+        EventFailable.h         \
+        Overlappable.h          \
+        Event.h                 \
+        Overlapped.h            \
+        Waiter.h                \
+        WaitableEvent.h         \
+        BufferedStream.h        \
+        StreamBuffer.h          \
+        ReadingBuffer.h         \
+        WritingBuffer.h         \
+        Completer.h             \
+        LocalSocket.h           \
+        LocalConnector.h        \
+        LocalClientSocket.h     \
+        LocalAcceptor.h         \
+        LocalServerSocketBase.h \
+        LocalServerSocket.h
Index: src/hu/varadiistvan/scpl/io/_win32/Makefile.am
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Makefile.am	(revision 25)
+++ 	(revision )
@@ -1,36 +1,0 @@
-AM_CPPFLAGS = -I$(top_builddir)/src
-
-SUBDIRS=
-
-noinst_LTLIBRARIES=libvscpl_io_win32.la
-
-libvscpl_io_win32_la_SOURCES=\
-        Event.cc                \
-        Overlapped.cc           \
-        Waiter.cc               \
-        BufferedStream.cc       \
-        ReadingBuffer.cc        \
-        WritingBuffer.cc        \
-        LocalConnector.cc       \
-        LocalAcceptor.cc        \
-        LocalServerSocketBase.cc
-
-include_vscpl_io_win32dir=$(includedir)/hu/varadiistvan/scpl/io/_win32
-include_vscpl_io_win32_HEADERS=\
-        EventFailable.h         \
-        Overlappable.h          \
-        Event.h                 \
-        Overlapped.h            \
-        Waiter.h                \
-        WaitableEvent.h         \
-        BufferedStream.h        \
-        StreamBuffer.h          \
-        ReadingBuffer.h         \
-        WritingBuffer.h         \
-        Completer.h             \
-        LocalSocket.h           \
-        LocalConnector.h        \
-        LocalClientSocket.h     \
-        LocalAcceptor.h         \
-        LocalServerSocketBase.h \
-        LocalServerSocket.h
Index: src/hu/varadiistvan/scpl/io/_win32/Overlappable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlappable.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/Overlappable.h	(revision 9)
@@ -0,0 +1,146 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
+//------------------------------------------------------------------------------
+
+#include "EventFailable.h"
+
+#include <windows.h>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Waiter;
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for classes that maintain a handle and may be subject to
+ * overlapped I/O operations whose completion is waited for in a
+ * Waiter.
+ */
+class Overlappable : public EventFailable
+{
+protected:
+    /**
+     * The waiter to be used for waiting for events.
+     */
+    Waiter* waiter;
+
+    /**
+     * The handle to use.
+     */
+    HANDLE handle;
+
+protected:
+    /**
+     * Construct the object.
+     */
+    Overlappable(Waiter* waiter = 0, HANDLE handle = 0);
+
+public:
+    /**
+     * Destroy the object.
+     */
+    virtual ~Overlappable();
+
+    /**
+     * Get the waiter.
+     */
+    Waiter* getWaiter();
+
+    /**
+     * Determine if the overlappable has a waiter.
+     */
+    bool hasWaiter() const;
+
+    /**
+     * Get the handle and clear it.
+     */
+    HANDLE releaseHandle();
+
+    friend class Completer;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Overlappable::Overlappable(Waiter* waiter, HANDLE handle) :
+    waiter(waiter),
+    handle(handle)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Overlappable::~Overlappable()
+{
+    if (handle!=0) CloseHandle(handle);
+}
+
+//------------------------------------------------------------------------------
+
+inline Waiter* Overlappable::getWaiter()
+{
+    return waiter;
+}
+
+//------------------------------------------------------------------------------
+
+inline bool Overlappable::hasWaiter() const
+{
+    return waiter != 0;
+}
+
+//------------------------------------------------------------------------------
+
+inline HANDLE Overlappable::releaseHandle()
+{
+    HANDLE h = handle;
+    handle = 0;
+    return h;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Overlappable.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlappable.h	(revision 9)
+++ 	(revision )
@@ -1,146 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
-//------------------------------------------------------------------------------
-
-#include "EventFailable.h"
-
-#include <windows.h>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Waiter;
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for classes that maintain a handle and may be subject to
- * overlapped I/O operations whose completion is waited for in a
- * Waiter.
- */
-class Overlappable : public EventFailable
-{
-protected:
-    /**
-     * The waiter to be used for waiting for events.
-     */
-    Waiter* waiter;
-
-    /**
-     * The handle to use.
-     */
-    HANDLE handle;
-
-protected:
-    /**
-     * Construct the object.
-     */
-    Overlappable(Waiter* waiter = 0, HANDLE handle = 0);
-
-public:
-    /**
-     * Destroy the object.
-     */
-    virtual ~Overlappable();
-
-    /**
-     * Get the waiter.
-     */
-    Waiter* getWaiter();
-
-    /**
-     * Determine if the overlappable has a waiter.
-     */
-    bool hasWaiter() const;
-
-    /**
-     * Get the handle and clear it.
-     */
-    HANDLE releaseHandle();
-
-    friend class Completer;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Overlappable::Overlappable(Waiter* waiter, HANDLE handle) :
-    waiter(waiter),
-    handle(handle)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Overlappable::~Overlappable()
-{
-    if (handle!=0) CloseHandle(handle);
-}
-
-//------------------------------------------------------------------------------
-
-inline Waiter* Overlappable::getWaiter()
-{
-    return waiter;
-}
-
-//------------------------------------------------------------------------------
-
-inline bool Overlappable::hasWaiter() const
-{
-    return waiter != 0;
-}
-
-//------------------------------------------------------------------------------
-
-inline HANDLE Overlappable::releaseHandle()
-{
-    HANDLE h = handle;
-    handle = 0;
-    return h;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPABLE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Overlapped.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlapped.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/Overlapped.cc	(revision 9)
@@ -0,0 +1,66 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Overlapped.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Overlapped;
+
+//------------------------------------------------------------------------------
+
+void Overlapped::reset()
+{
+    memset(&overlapped, 0, sizeof(overlapped));
+    overlapped.hEvent = getHandle();
+    clear();
+}
+
+//------------------------------------------------------------------------------
+
+bool Overlapped::getResult(DWORD& size, HANDLE file)
+{
+    bool result = GetOverlappedResult(file, &overlapped, &size, FALSE);
+    if (!result) {
+        DWORD error = GetLastError();
+        if (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE) {
+            setErrorCode(error);
+        }
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Overlapped.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlapped.cc	(revision 9)
+++ 	(revision )
@@ -1,66 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Overlapped.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Overlapped;
-
-//------------------------------------------------------------------------------
-
-void Overlapped::reset()
-{
-    memset(&overlapped, 0, sizeof(overlapped));
-    overlapped.hEvent = getHandle();
-    clear();
-}
-
-//------------------------------------------------------------------------------
-
-bool Overlapped::getResult(DWORD& size, HANDLE file)
-{
-    bool result = GetOverlappedResult(file, &overlapped, &size, FALSE);
-    if (!result) {
-        DWORD error = GetLastError();
-        if (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE) {
-            setErrorCode(error);
-        }
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Overlapped.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlapped.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/Overlapped.h	(revision 9)
@@ -0,0 +1,129 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
+//------------------------------------------------------------------------------
+
+#include "Event.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A wrapper for an OVERLAPPED structure which also has an event
+ * associated with it. Instances of this class can be registered into and
+ * unregistered from a Waiter. The destructor removes the object from
+ * the waiter, if it is registered.
+ */
+class Overlapped : public Event
+{
+private:
+    /**
+     * The Windows OVERLAPPED structure.
+     */
+    OVERLAPPED overlapped;
+
+public:
+    /**
+     * Construct the object. The overlapped structure will be reset to
+     * 0, and the event handle will be set.
+     */
+    Overlapped(EventFailable& eventFailable);
+
+    /**
+     * Reset the overlapped structure and set its event handle. The
+     * event is also cleared.
+     */
+    void reset();
+
+    /**
+     * Get the pointer to the overlapped structure.
+     */
+    OVERLAPPED* get();
+
+    /**
+     * Get the pointer to the overlapped structure.
+     */
+    const OVERLAPPED* get() const;
+
+    /**
+     * Get the result of the overlapped operation.
+     *
+     * If the operation has completed, the event will be cleared.
+     *
+     * @param size on successful return, it will contain the number of
+     * bytes read or written, which may be 0 for an end-of-file
+     * condition
+     * @param file the handle of the object on which the operation in
+     * question was performed
+     *
+     * @return true if the operation has completed, or false if it has
+     * not, or a failure has occured.
+     */
+    bool getResult(DWORD& size, HANDLE file);
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Overlapped::Overlapped(EventFailable& eventFailable) :
+    Event(eventFailable)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline OVERLAPPED* Overlapped::get()
+{
+    return &overlapped;
+}
+
+//------------------------------------------------------------------------------
+
+inline const OVERLAPPED* Overlapped::get() const
+{
+    return &overlapped;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Overlapped.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Overlapped.h	(revision 9)
+++ 	(revision )
@@ -1,129 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
-//------------------------------------------------------------------------------
-
-#include "Event.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A wrapper for an OVERLAPPED structure which also has an event
- * associated with it. Instances of this class can be registered into and
- * unregistered from a Waiter. The destructor removes the object from
- * the waiter, if it is registered.
- */
-class Overlapped : public Event
-{
-private:
-    /**
-     * The Windows OVERLAPPED structure.
-     */
-    OVERLAPPED overlapped;
-
-public:
-    /**
-     * Construct the object. The overlapped structure will be reset to
-     * 0, and the event handle will be set.
-     */
-    Overlapped(EventFailable& eventFailable);
-
-    /**
-     * Reset the overlapped structure and set its event handle. The
-     * event is also cleared.
-     */
-    void reset();
-
-    /**
-     * Get the pointer to the overlapped structure.
-     */
-    OVERLAPPED* get();
-
-    /**
-     * Get the pointer to the overlapped structure.
-     */
-    const OVERLAPPED* get() const;
-
-    /**
-     * Get the result of the overlapped operation.
-     *
-     * If the operation has completed, the event will be cleared.
-     *
-     * @param size on successful return, it will contain the number of
-     * bytes read or written, which may be 0 for an end-of-file
-     * condition
-     * @param file the handle of the object on which the operation in
-     * question was performed
-     *
-     * @return true if the operation has completed, or false if it has
-     * not, or a failure has occured.
-     */
-    bool getResult(DWORD& size, HANDLE file);
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Overlapped::Overlapped(EventFailable& eventFailable) :
-    Event(eventFailable)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline OVERLAPPED* Overlapped::get()
-{
-    return &overlapped;
-}
-
-//------------------------------------------------------------------------------
-
-inline const OVERLAPPED* Overlapped::get() const
-{
-    return &overlapped;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_OVERLAPPED_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.cc	(revision 9)
@@ -0,0 +1,77 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ReadingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::ReadingBuffer;
+
+//------------------------------------------------------------------------------
+
+bool ReadingBuffer::read()
+{
+    if (failed()) return false;
+
+    if (getLength()>0) {
+        return true;
+    }
+
+    bool result = false;
+    if (checkWaitedResult(result)) {
+        return result;
+    }
+
+    BufferedStream& stream = getStream();
+    ssize_t numRead = stream.read(getData(), getCapacity(), overlapped);
+    if (numRead<0) {
+        if (!stream.failed()) {
+            addTo(stream.getWaiter());
+        }
+    } else {
+        addLength(numRead);
+    }
+    return numRead>=0;
+}
+
+//------------------------------------------------------------------------------
+
+void ReadingBuffer::handleWaitedResult(DWORD size)
+{
+    addLength(size);
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.cc	(revision 9)
+++ 	(revision )
@@ -1,77 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ReadingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::ReadingBuffer;
-
-//------------------------------------------------------------------------------
-
-bool ReadingBuffer::read()
-{
-    if (failed()) return false;
-
-    if (getLength()>0) {
-        return true;
-    }
-
-    bool result = false;
-    if (checkWaitedResult(result)) {
-        return result;
-    }
-
-    BufferedStream& stream = getStream();
-    ssize_t numRead = stream.read(getData(), getCapacity(), overlapped);
-    if (numRead<0) {
-        if (!stream.failed()) {
-            addTo(stream.getWaiter());
-        }
-    } else {
-        addLength(numRead);
-    }
-    return numRead>=0;
-}
-
-//------------------------------------------------------------------------------
-
-void ReadingBuffer::handleWaitedResult(DWORD size)
-{
-    addLength(size);
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.h	(revision 9)
@@ -0,0 +1,109 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "StreamBuffer.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for reading from a stream buffer.
+ *
+ * It should be made empty, and then the function read() should be
+ * called on it. If it returns true, some data could be read. If the
+ * amount of data in the buffer is then 0, that indicates and
+ * end-of-file condition.
+ */
+class ReadingBuffer : public StreamBuffer
+{
+protected:
+    /**
+     * Construct the buffer.
+     */
+    ReadingBuffer(size_t capacity, BufferedStream* stream);
+
+public:
+    /**
+     * Read into the buffer using the buffered stream if possible.
+     *
+     * If the buffer contains data, this function returns immediately
+     * with success, so the buffer should be reset before reading.
+     *
+     * If some data can be read immediately, that is stored in the
+     * buffer, and success is indicated. Success is indicated even if
+     * the amount of data read is 0, allowing for signalling the
+     * end-of-file or end-of-connection condition.
+     *
+     * If the reading operation would block, the stream is set up so
+     * that it would read, and failure is returned.
+     *
+     * Otherwise, if the reading operation fails for some other
+     * reason, the buffer's error code is set, so it should always be
+     * checked on a failure!
+     */
+    bool read();
+
+protected:
+    /**
+     * Set the buffer's length to the given value.
+     *
+     * @see Completer::handleWaitedResult
+     */
+    virtual void handleWaitedResult(DWORD size);
+
+    friend class BufferedStream;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ReadingBuffer::ReadingBuffer(size_t capacity, BufferedStream* stream) :
+    StreamBuffer(capacity, stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/ReadingBuffer.h	(revision 9)
+++ 	(revision )
@@ -1,109 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "StreamBuffer.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for reading from a stream buffer.
- *
- * It should be made empty, and then the function read() should be
- * called on it. If it returns true, some data could be read. If the
- * amount of data in the buffer is then 0, that indicates and
- * end-of-file condition.
- */
-class ReadingBuffer : public StreamBuffer
-{
-protected:
-    /**
-     * Construct the buffer.
-     */
-    ReadingBuffer(size_t capacity, BufferedStream* stream);
-
-public:
-    /**
-     * Read into the buffer using the buffered stream if possible.
-     *
-     * If the buffer contains data, this function returns immediately
-     * with success, so the buffer should be reset before reading.
-     *
-     * If some data can be read immediately, that is stored in the
-     * buffer, and success is indicated. Success is indicated even if
-     * the amount of data read is 0, allowing for signalling the
-     * end-of-file or end-of-connection condition.
-     *
-     * If the reading operation would block, the stream is set up so
-     * that it would read, and failure is returned.
-     *
-     * Otherwise, if the reading operation fails for some other
-     * reason, the buffer's error code is set, so it should always be
-     * checked on a failure!
-     */
-    bool read();
-
-protected:
-    /**
-     * Set the buffer's length to the given value.
-     *
-     * @see Completer::handleWaitedResult
-     */
-    virtual void handleWaitedResult(DWORD size);
-
-    friend class BufferedStream;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ReadingBuffer::ReadingBuffer(size_t capacity, BufferedStream* stream) :
-    StreamBuffer(capacity, stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_READINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/StreamBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/StreamBuffer.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/StreamBuffer.h	(revision 9)
@@ -0,0 +1,93 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "../Buffer.h"
+#include "Completer.h"
+
+#include "BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for stream reading and writing buffers.
+ */
+class StreamBuffer : public Buffer, public Completer
+{
+protected:
+    /**
+     * Construct the stream buffer with the given capacity and for the
+     * given stream.
+     */
+    StreamBuffer(size_t capacity, BufferedStream* stream);
+
+    /**
+     * Get the stream.
+     *
+     * This just casts the overlappable of the Completer part knowing
+     * that it must be a BufferedStream
+     */
+    BufferedStream& getStream() const;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
+    Buffer(capacity),
+    Completer(stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline BufferedStream& StreamBuffer::getStream() const
+{
+    return static_cast<BufferedStream&>(overlappable);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/StreamBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/StreamBuffer.h	(revision 9)
+++ 	(revision )
@@ -1,93 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "../Buffer.h"
-#include "Completer.h"
-
-#include "BufferedStream.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for stream reading and writing buffers.
- */
-class StreamBuffer : public Buffer, public Completer
-{
-protected:
-    /**
-     * Construct the stream buffer with the given capacity and for the
-     * given stream.
-     */
-    StreamBuffer(size_t capacity, BufferedStream* stream);
-
-    /**
-     * Get the stream.
-     *
-     * This just casts the overlappable of the Completer part knowing
-     * that it must be a BufferedStream
-     */
-    BufferedStream& getStream() const;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
-    Buffer(capacity),
-    Completer(stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline BufferedStream& StreamBuffer::getStream() const
-{
-    return static_cast<BufferedStream&>(overlappable);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_STREAMBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WaitableEvent.h	(revision 7)
+++ src/hu/varadiistvan/scpl/io/_win32/WaitableEvent.h	(revision 7)
@@ -0,0 +1,91 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
+//------------------------------------------------------------------------------
+
+#include "Event.h"
+#include "EventFailable.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+/**
+ * An event which can be waited for.
+ */
+class WaitableEvent : public Event, public EventFailable
+{
+public:
+    /**
+     * Construct the event.
+     */
+    WaitableEvent(Waiter* waiter = 0);
+
+    /**
+     * Check if the event is fired or not. If so, the fired status
+     * will be cleared.
+     */
+    bool check();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline WaitableEvent::WaitableEvent(Waiter* waiter) :
+    Event(static_cast<EventFailable&>(*this))
+{
+    if (waiter!=0) addTo(*waiter);
+}
+
+//------------------------------------------------------------------------------
+
+inline bool WaitableEvent::check()
+{
+    if (isFired()) {
+        clear();
+        return true;
+    } else {
+        return false;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WaitableEvent.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WaitableEvent.h	(revision 7)
+++ 	(revision )
@@ -1,91 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
-//------------------------------------------------------------------------------
-
-#include "Event.h"
-#include "EventFailable.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-/**
- * An event which can be waited for.
- */
-class WaitableEvent : public Event, public EventFailable
-{
-public:
-    /**
-     * Construct the event.
-     */
-    WaitableEvent(Waiter* waiter = 0);
-
-    /**
-     * Check if the event is fired or not. If so, the fired status
-     * will be cleared.
-     */
-    bool check();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline WaitableEvent::WaitableEvent(Waiter* waiter) :
-    Event(static_cast<EventFailable&>(*this))
-{
-    if (waiter!=0) addTo(*waiter);
-}
-
-//------------------------------------------------------------------------------
-
-inline bool WaitableEvent::check()
-{
-    if (isFired()) {
-        clear();
-        return true;
-    } else {
-        return false;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WAITABLEEVENT_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Waiter.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Waiter.cc	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/Waiter.cc	(revision 6)
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "Waiter.h"
+
+#include "Event.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::Waiter;
+
+//------------------------------------------------------------------------------
+
+Waiter::~Waiter()
+{
+    while(!events.empty()) {
+        Event* event = *events.begin();
+        event->removeFromWaiter();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+bool Waiter::wait(int timeout)
+{
+    if (numEvents==0) return true;
+
+    HANDLE handles[numEvents];
+    size_t j = 0;
+    for(events_t::const_iterator i = events.begin();
+        i!=events.end(); ++i, ++j)
+    {
+        handles[j] = (*i)->getHandle();
+    }
+
+    DWORD result = WaitForMultipleObjects(numEvents, handles, false,
+                                          (timeout<0) ? INFINITE : timeout);
+    if (result==WAIT_FAILED) {
+        setErrorCode(GetLastError());
+        return false;
+    } else {
+        return result!=WAIT_TIMEOUT;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Waiter.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Waiter.cc	(revision 6)
+++ 	(revision )
@@ -1,79 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "Waiter.h"
-
-#include "Event.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::Waiter;
-
-//------------------------------------------------------------------------------
-
-Waiter::~Waiter()
-{
-    while(!events.empty()) {
-        Event* event = *events.begin();
-        event->removeFromWaiter();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-bool Waiter::wait(int timeout)
-{
-    if (numEvents==0) return true;
-
-    HANDLE handles[numEvents];
-    size_t j = 0;
-    for(events_t::const_iterator i = events.begin();
-        i!=events.end(); ++i, ++j)
-    {
-        handles[j] = (*i)->getHandle();
-    }
-
-    DWORD result = WaitForMultipleObjects(numEvents, handles, false,
-                                          (timeout<0) ? INFINITE : timeout);
-    if (result==WAIT_FAILED) {
-        setErrorCode(GetLastError());
-        return false;
-    } else {
-        return result!=WAIT_TIMEOUT;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Waiter.h	(revision 6)
+++ src/hu/varadiistvan/scpl/io/_win32/Waiter.h	(revision 6)
@@ -0,0 +1,140 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
+//------------------------------------------------------------------------------
+
+#include "../Failable.h"
+
+#include <set>
+
+#include <cassert>
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class Event;
+
+/**
+ * Class that can be used to register OVERLAPPED structures and then
+ * wait for their events.
+ */
+class Waiter : public Failable
+{
+private:
+    /**
+     * Type for the mapping of events to overlapped objects.
+     */
+    typedef std::set<Event*> events_t;
+
+    /**
+     * The events to be handled.
+     */
+    events_t events;
+
+    /**
+     * The number of events.
+     */
+    size_t numEvents;
+
+public:
+    /**
+     * Construct the waiter.
+     */
+    Waiter();
+
+    /**
+     * Destroy the waiter. It will be removed from any Event
+     * objects it may be related to.
+     */
+    ~Waiter();
+
+    /**
+     * Wait for an event to occur with the given timeout.
+     *
+     * @return true if any of the events belonging to the Overlapped
+     * objects become ready, false if the timeout occurs.
+     */
+    bool wait(int timeout = -1);
+
+protected:
+    /**
+     * Add the given event to the set of those to be waited for.
+     */
+    void add(Event* event);
+
+    /**
+     * Remove the given event from the set of those to be waited for.
+     */
+    void remove(Event* event);
+
+    friend class Event;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Waiter::Waiter() :
+    numEvents(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline void Waiter::add(Event* event)
+{
+    events.insert(event);
+    ++numEvents;
+}
+
+//------------------------------------------------------------------------------
+
+inline void Waiter::remove(Event* event)
+{
+    assert(numEvents>0);
+    --numEvents;
+    events.erase(event);
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/Waiter.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/Waiter.h	(revision 6)
+++ 	(revision )
@@ -1,140 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
-//------------------------------------------------------------------------------
-
-#include "../Failable.h"
-
-#include <set>
-
-#include <cassert>
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class Event;
-
-/**
- * Class that can be used to register OVERLAPPED structures and then
- * wait for their events.
- */
-class Waiter : public Failable
-{
-private:
-    /**
-     * Type for the mapping of events to overlapped objects.
-     */
-    typedef std::set<Event*> events_t;
-
-    /**
-     * The events to be handled.
-     */
-    events_t events;
-
-    /**
-     * The number of events.
-     */
-    size_t numEvents;
-
-public:
-    /**
-     * Construct the waiter.
-     */
-    Waiter();
-
-    /**
-     * Destroy the waiter. It will be removed from any Event
-     * objects it may be related to.
-     */
-    ~Waiter();
-
-    /**
-     * Wait for an event to occur with the given timeout.
-     *
-     * @return true if any of the events belonging to the Overlapped
-     * objects become ready, false if the timeout occurs.
-     */
-    bool wait(int timeout = -1);
-
-protected:
-    /**
-     * Add the given event to the set of those to be waited for.
-     */
-    void add(Event* event);
-
-    /**
-     * Remove the given event from the set of those to be waited for.
-     */
-    void remove(Event* event);
-
-    friend class Event;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Waiter::Waiter() :
-    numEvents(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline void Waiter::add(Event* event)
-{
-    events.insert(event);
-    ++numEvents;
-}
-
-//------------------------------------------------------------------------------
-
-inline void Waiter::remove(Event* event)
-{
-    assert(numEvents>0);
-    --numEvents;
-    events.erase(event);
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WAITER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.cc	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.cc	(revision 9)
@@ -0,0 +1,76 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "WritingBuffer.h"
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::scpl::io::WritingBuffer;
+
+//------------------------------------------------------------------------------
+
+bool WritingBuffer::write()
+{
+    if (failed()) return false;
+
+    if (getLength()==0) {
+        return true;
+    }
+
+    bool result;
+    if (checkWaitedResult(result)) {
+        return result;
+    }
+
+    BufferedStream& stream = getStream();
+    result = stream.write(getData(), getLength(), overlapped);
+    if (result) {
+        reset();
+    } else if (!stream.failed()) {
+        addTo(stream.getWaiter());
+    }
+
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+void WritingBuffer::handleWaitedResult(DWORD /*size*/)
+{
+    reset();
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.cc
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.cc	(revision 9)
+++ 	(revision )
@@ -1,76 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "WritingBuffer.h"
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::scpl::io::WritingBuffer;
-
-//------------------------------------------------------------------------------
-
-bool WritingBuffer::write()
-{
-    if (failed()) return false;
-
-    if (getLength()==0) {
-        return true;
-    }
-
-    bool result;
-    if (checkWaitedResult(result)) {
-        return result;
-    }
-
-    BufferedStream& stream = getStream();
-    result = stream.write(getData(), getLength(), overlapped);
-    if (result) {
-        reset();
-    } else if (!stream.failed()) {
-        addTo(stream.getWaiter());
-    }
-
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-void WritingBuffer::handleWaitedResult(DWORD /*size*/)
-{
-    reset();
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.h	(revision 9)
+++ src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.h	(revision 9)
@@ -0,0 +1,109 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
+#define HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "StreamBuffer.h"
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A buffer used for writing into a buffered stream.
+ *
+ * The data to write should be stored in the buffer. Then write()
+ * should be called. If it returns true, it indicates that all data
+ * has been written. In that case the buffer is automatically emptied.
+ */
+class WritingBuffer : public StreamBuffer
+{
+protected:
+    /**
+     * Construct the buffer.
+     */
+    WritingBuffer(size_t capacity, BufferedStream* stream);
+
+public:
+    /**
+     * Write the contents of the buffer using the associated buffered
+     * stream.
+     *
+     * If the buffer is empty, the function returns indicating
+     * success.
+     *
+     * If the complete remaining contents could be written, it also indicates
+     * success, and the buffer is reset, ready to be used again.
+     *
+     * If not everything can be written and the write operation
+     * indicates that it would block, this function returns failure
+     * after the stream has been set up  to handle the corresponding
+     * poll events.
+     *
+     * Otherwise, if the writing operation fails for some other
+     * reason, the buffer's error code is set to the error's code and
+     * false is returned.
+     */
+    bool write();
+
+protected:
+    /**
+     * Reset the buffer to signify that its contents have been written.
+     *
+     * @see Completer::handleWaitedResult
+     */
+    virtual void handleWaitedResult(DWORD size);
+
+    friend class BufferedStream;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline WritingBuffer::WritingBuffer(size_t capacity, BufferedStream* stream) :
+    StreamBuffer(capacity, stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.h
===================================================================
--- src/hu/varadiistvan/scpl/io/_win32/WritingBuffer.h	(revision 9)
+++ 	(revision )
@@ -1,109 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
-#define HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "StreamBuffer.h"
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-/**
- * A buffer used for writing into a buffered stream.
- *
- * The data to write should be stored in the buffer. Then write()
- * should be called. If it returns true, it indicates that all data
- * has been written. In that case the buffer is automatically emptied.
- */
-class WritingBuffer : public StreamBuffer
-{
-protected:
-    /**
-     * Construct the buffer.
-     */
-    WritingBuffer(size_t capacity, BufferedStream* stream);
-
-public:
-    /**
-     * Write the contents of the buffer using the associated buffered
-     * stream.
-     *
-     * If the buffer is empty, the function returns indicating
-     * success.
-     *
-     * If the complete remaining contents could be written, it also indicates
-     * success, and the buffer is reset, ready to be used again.
-     *
-     * If not everything can be written and the write operation
-     * indicates that it would block, this function returns failure
-     * after the stream has been set up  to handle the corresponding
-     * poll events.
-     *
-     * Otherwise, if the writing operation fails for some other
-     * reason, the buffer's error code is set to the error's code and
-     * false is returned.
-     */
-    bool write();
-
-protected:
-    /**
-     * Reset the buffer to signify that its contents have been written.
-     *
-     * @see Completer::handleWaitedResult
-     */
-    virtual void handleWaitedResult(DWORD size);
-
-    friend class BufferedStream;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline WritingBuffer::WritingBuffer(size_t capacity, BufferedStream* stream) :
-    StreamBuffer(capacity, stream)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_IO_WIN32_WRITINGBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/hu/varadiistvan/scpl/io/hgccwrapper
===================================================================
--- src/hu/varadiistvan/scpl/io/hgccwrapper	(revision 6)
+++ src/hu/varadiistvan/scpl/io/hgccwrapper	(revision 6)
@@ -0,0 +1,96 @@
+#!/bin/sh
+
+# Create a skeleton of a wrapper header for a certain class
+
+classname=$1
+uppername=`echo ${classname} | tr a-z A-Z`
+
+cat > "${classname}.h" <<EOF
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_IO_${uppername}_H
+#define HU_VARADIISTVAN_SCPL_IO_${uppername}_H
+//------------------------------------------------------------------------------
+
+#if 0 // The public interface of ${classname}
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl { namespace io {
+
+//------------------------------------------------------------------------------
+
+class ${classname}
+{
+public:
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+
+#endif // 0, The public interface of ${classname}
+
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_POSIX
+
+#include "_posix/${classname}.h"
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_WIN32 || TARGET_API_WIN64
+
+#include "_win32/${classname}.h"
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_${uppername}_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
+EOF
+
+hg add "${classname}.h"
Index: src/hu/varadiistvan/scpl/io/hgccwrapper
===================================================================
--- src/hu/varadiistvan/scpl/io/hgccwrapper	(revision 6)
+++ 	(revision )
@@ -1,96 +1,0 @@
-#!/bin/sh
-
-# Create a skeleton of a wrapper header for a certain class
-
-classname=$1
-uppername=`echo ${classname} | tr a-z A-Z`
-
-cat > "${classname}.h" <<EOF
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_IO_${uppername}_H
-#define HU_VARADIISTVAN_SCPL_IO_${uppername}_H
-//------------------------------------------------------------------------------
-
-#if 0 // The public interface of ${classname}
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl { namespace io {
-
-//------------------------------------------------------------------------------
-
-class ${classname}
-{
-public:
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl::io */ } /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-
-#endif // 0, The public interface of ${classname}
-
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_POSIX
-
-#include "_posix/${classname}.h"
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_WIN32 || TARGET_API_WIN64
-
-#include "_win32/${classname}.h"
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_${uppername}_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
-EOF
-
-hg add "${classname}.h"
Index: src/hu/varadiistvan/scpl/types.h
===================================================================
--- src/hu/varadiistvan/scpl/types.h	(revision 6)
+++ src/hu/varadiistvan/scpl/types.h	(revision 6)
@@ -0,0 +1,80 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of VSCPL, a simple cross-platform utility library
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef HU_VARADIISTVAN_SCPL_TYPES_H
+#define HU_VARADIISTVAN_SCPL_TYPES_H
+//------------------------------------------------------------------------------
+
+#include "hu/varadiistvan/scpl/config.h"
+
+#if TARGET_API_WIN32
+#include <windows.h>
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace hu { namespace varadiistvan { namespace scpl {
+
+//------------------------------------------------------------------------------
+
+#if TARGET_API_WIN32 || TARGET_API_WIN64
+
+//------------------------------------------------------------------------------
+
+typedef DWORD errorCode_t;
+static const DWORD XPL_NO_ERROR = 0;
+
+//------------------------------------------------------------------------------
+
+#elif TARGET_API_POSIX
+
+//------------------------------------------------------------------------------
+
+typedef int errorCode_t;
+static const int XPL_NO_ERROR = 0;
+
+//------------------------------------------------------------------------------
+
+#else
+
+#error "Not implemented for this target!"
+
+#endif
+
+//------------------------------------------------------------------------------
+
+} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
+
+//------------------------------------------------------------------------------
+#endif // HU_VARADIISTVAN_SCPL_TYPES_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/hu/varadiistvan/scpl/types.h
===================================================================
--- src/hu/varadiistvan/scpl/types.h	(revision 6)
+++ 	(revision )
@@ -1,80 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of VSCPL, a simple cross-platform utility library
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef HU_VARADIISTVAN_SCPL_TYPES_H
-#define HU_VARADIISTVAN_SCPL_TYPES_H
-//------------------------------------------------------------------------------
-
-#include "hu/varadiistvan/scpl/config.h"
-
-#if TARGET_API_WIN32
-#include <windows.h>
-#endif
-
-//------------------------------------------------------------------------------
-
-namespace hu { namespace varadiistvan { namespace scpl {
-
-//------------------------------------------------------------------------------
-
-#if TARGET_API_WIN32 || TARGET_API_WIN64
-
-//------------------------------------------------------------------------------
-
-typedef DWORD errorCode_t;
-static const DWORD XPL_NO_ERROR = 0;
-
-//------------------------------------------------------------------------------
-
-#elif TARGET_API_POSIX
-
-//------------------------------------------------------------------------------
-
-typedef int errorCode_t;
-static const int XPL_NO_ERROR = 0;
-
-//------------------------------------------------------------------------------
-
-#else
-
-#error "Not implemented for this target!"
-
-#endif
-
-//------------------------------------------------------------------------------
-
-} /* namespace hu::varadiistvan::scpl */ } /* namespace hu::varadiistvan */ } /* namespace hu */
-
-//------------------------------------------------------------------------------
-#endif // HU_VARADIISTVAN_SCPL_TYPES_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
