diff -Narup gearbox.old/cmake/internal/Setup.cmake gearbox/cmake/internal/Setup.cmake
--- gearbox.old/cmake/internal/Setup.cmake 2008-09-24 18:46:44.000000000 +0200
+++ gearbox/cmake/internal/Setup.cmake 2008-09-24 18:48:53.000000000 +0200
@@ -40,7 +40,7 @@ INCLUDE( ${GBX_CMAKE_DIR}/DependencyUtil
# Defaults for big source code switches
# (these are defaults. after the user modifies these in GUI they stay in cache)
#
-OPTION( GBX_BUILD_LICENSE "Enables writing LICENCE file. For admins only." OFF )
+OPTION( GBX_BUILD_LICENSE "Enables writing LICENCE file. For admins only." ON )
#
# check compiler type and version
@@ -77,7 +77,7 @@ SET( CMAKE_INSTALL_RPATH ${GBX_LIB_INSTA
# Enable testing by including the Dart module
# (must be done *before* entering source directories )
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
-ENABLE_TESTING()
+ENABLE_TESTING(ON)
#
# Enter the source tree
diff -Narup gearbox.old/cmake/SetupDirectories.cmake gearbox/cmake/SetupDirectories.cmake
--- gearbox.old/cmake/SetupDirectories.cmake 2008-07-25 14:15:01.000000000 +0200
+++ gearbox/cmake/SetupDirectories.cmake 2008-09-24 18:10:21.000000000 +0200
@@ -22,7 +22,7 @@
IF( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
MESSAGE( STATUS "Setting default installation directory..." )
IF( NOT GBX_OS_WIN )
- SET( CMAKE_INSTALL_PREFIX /usr/local CACHE PATH "Installation directory" FORCE )
+ SET( CMAKE_INSTALL_PREFIX /usr CACHE PATH "Installation directory" FORCE )
ELSE ( NOT GBX_OS_WIN )
SET( CMAKE_INSTALL_PREFIX "C:\Program Files\${PROJECT_NAME}\Include" CACHE PATH "Installation directory" FORCE )
ENDIF( NOT GBX_OS_WIN )
diff -Narup gearbox.old/CMakeLists.txt gearbox/CMakeLists.txt
--- gearbox.old/CMakeLists.txt 2008-07-25 14:16:42.000000000 +0200
+++ gearbox/CMakeLists.txt 2008-09-24 18:10:21.000000000 +0200
@@ -11,7 +11,7 @@ PROJECT( gearbox )
#
# project version string
#
-SET( GBX_PROJECT_VERSION 8.07 CACHE STRING "Version of GearBox distribution" )
+SET( GBX_PROJECT_VERSION 8.07+ CACHE STRING "Version of GearBox distribution" )
#
# The rest is done by a script
diff -Narup gearbox.old/doc/images/gearbox_logo.svg gearbox/doc/images/gearbox_logo.svg
--- gearbox.old/doc/images/gearbox_logo.svg 1970-01-01 01:00:00.000000000 +0100
+++ gearbox/doc/images/gearbox_logo.svg 2008-09-24 18:10:21.000000000 +0200
@@ -0,0 +1,120 @@
+
+
+
diff -Narup gearbox.old/doc/release_instructions.dox gearbox/doc/release_instructions.dox
--- gearbox.old/doc/release_instructions.dox 2008-07-25 14:25:57.000000000 +0200
+++ gearbox/doc/release_instructions.dox 2008-09-24 18:10:21.000000000 +0200
@@ -30,21 +30,21 @@
-# Check in those changes.
-# Tag the distributions, eg with:
@verbatim
-$ svn copy https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/tags/RELEASE_1.7.0 -m 'Tagging release 1.7.0'
+$ svn copy https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/trunk https://gearbox.svn.sf.net/svnroot/gearbox/gearbox/tags/RELEASE_9.02 -m 'Tagging release 9.02'
@endverbatim
-# Delete all .svn directories (eg with 'find . -name .svn | xargs rm -rf')
- -# Create tar-ball, named eg. 'gearbox-1.7.0.tar.gz'
+ -# Create tar-ball, named eg. 'gearbox-9.02.tar.gz'
-# Now the tar-ball is ready to roll. But first test that the original untars and builds cleanly.
-# Copy the tar-ball to a machine with external access.
-# On a machine with external access:
- -# ftp to upload.sf.net (anonymous login)
- -# cd /incoming
+ -# sftp [USERNAME]\@frs.sf.net
+ -# cd uploads
-# 'put' the tarball
-# Create a new distro through the sourceforge web interface
- Login a project administrator
- (Go through "'Admin' -> 'File Releases'" from the GearBox project page)
-# Update the web page
- Use the script: /doc/rebuild_docco.sh
--# Increment the version numbers (eg '1.7.0' -> '1.7.0+') in the top-level CMakeLists.txt files.
+-# Increment the version numbers (eg '9.02' -> '9.02+') in the top-level CMakeLists.txt files.
*/
diff -Narup gearbox.old/retired/CMakeLists.txt gearbox/retired/CMakeLists.txt
--- gearbox.old/retired/CMakeLists.txt 2008-07-25 14:15:11.000000000 +0200
+++ gearbox/retired/CMakeLists.txt 2008-09-24 18:10:21.000000000 +0200
@@ -1,6 +1,6 @@
# A place for libraries that have been retired from the source tree.
-OPTION ( GBX_BUILD_RETIRED "Build retired libraries" OFF )
+OPTION ( GBX_BUILD_RETIRED "Build retired libraries" ON )
MARK_AS_ADVANCED ( FORCE GBX_BUILD_RETIRED )
IF( GBX_BUILD_RETIRED )
diff -Narup gearbox.old/src/basicexample/CMakeLists.txt gearbox/src/basicexample/CMakeLists.txt
--- gearbox.old/src/basicexample/CMakeLists.txt 2008-07-25 14:15:10.000000000 +0200
+++ gearbox/src/basicexample/CMakeLists.txt 2008-09-24 18:10:21.000000000 +0200
@@ -2,7 +2,7 @@ SET( lib_name basicexample )
GBX_ADD_LICENSE( LGPL )
SET( build TRUE )
-GBX_REQUIRE_OPTION( build LIB ${lib_name} OFF )
+GBX_REQUIRE_OPTION( build LIB ${lib_name} ON )
IF( build )
diff -Narup gearbox.old/src/flexiport/flexiport.cpp gearbox/src/flexiport/flexiport.cpp
--- gearbox.old/src/flexiport/flexiport.cpp 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/flexiport.cpp 2008-09-24 18:10:21.000000000 +0200
@@ -4,17 +4,17 @@
* Copyright (c) 2008 Geoffrey Biggs
*
* flexiport flexible hardware data communications library.
- *
- * This distribution is licensed to you under the terms described in the LICENSE file included in
+ *
+ * This distribution is licensed to you under the terms described in the LICENSE file included in
* this distribution.
*
* This work is a product of the National Institute of Advanced Industrial Science and Technology,
* Japan. Registration number: H20PRO-881
- *
+ *
* This file is part of flexiport.
*
* flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation, either version 3 of
+ * Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
@@ -103,49 +103,28 @@ Port* CreatePort (map op
#ifdef FLEXIPORT_INCLUDE_SERIAL
if (type == "serial")
- {
- SerialPort *newPort = new SerialPort (options);
- if (newPort == NULL)
- throw PortException ("Failed to allocate new port");
- return newPort;
- }
+ return new SerialPort (options);
#endif // FLEXIPORT_INCLUDE_SERIAL
#ifdef FLEXIPORT_INCLUDE_TCP
if (type == "tcp")
- {
- TCPPort *newPort = new TCPPort (options);
- if (newPort == NULL)
- throw PortException ("Failed to allocate new port");
- return newPort;
- }
+ return new TCPPort (options);
#endif // FLEXIPORT_INCLUDE_TCP
#ifdef FLEXIPORT_INCLUDE_LOGGING
if (type == "logreader")
- {
- LogReaderPort *newPort = new LogReaderPort (options);
- if (newPort == NULL)
- throw PortException ("Failed to allocate new port");
- return newPort;
- }
+ return new LogReaderPort (options);
#ifdef FLEXIPORT_INCLUDE_SERIAL
if (type == "seriallog")
{
options["type"] = "serial";
- LogWriterPort *newPort = new LogWriterPort (options);
- if (newPort == NULL)
- throw PortException ("Failed to allocate new port");
- return newPort;
+ return new LogWriterPort (options);
}
#endif // FLEXIPORT_INCLUDE_SERIAL
#ifdef FLEXIPORT_INCLUDE_TCP
if (type == "tcplog")
{
options["type"] = "tcp";
- LogWriterPort *newPort = new LogWriterPort (options);
- if (newPort == NULL)
- throw PortException ("Failed to allocate new port");
- return newPort;
+ return new LogWriterPort (options);
}
#endif // FLEXIPORT_INCLUDE_TCP
#endif // FLEXIPORT_INCLUDE_LOGGING
diff -Narup gearbox.old/src/flexiport/logfile.cpp gearbox/src/flexiport/logfile.cpp
--- gearbox.old/src/flexiport/logfile.cpp 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/logfile.cpp 2008-09-24 18:10:21.000000000 +0200
@@ -633,11 +633,7 @@ bool LogFile::CheckWrite (const void * c
// Allocate space to store the data to compare with
uint8_t *fileData;
- if ((fileData = new uint8_t[count]) == NULL)
- {
- throw PortException (string ("LogFile::") + __func__ +
- string ("Failed to allocate temporary space for write comparison."));
- }
+ fileData = new uint8_t[count];
// Pull any data out of the overflow first
bool needMore = true;
diff -Narup gearbox.old/src/flexiport/logreaderport.cpp gearbox/src/flexiport/logreaderport.cpp
--- gearbox.old/src/flexiport/logreaderport.cpp 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/logreaderport.cpp 2008-09-24 18:10:21.000000000 +0200
@@ -52,11 +52,7 @@ LogReaderPort::LogReaderPort (mapOpen (_logFileName, true, _ignoreTimes);
if (_alwaysOpen)
diff -Narup gearbox.old/src/flexiport/logwriterport.cpp gearbox/src/flexiport/logwriterport.cpp
--- gearbox.old/src/flexiport/logwriterport.cpp 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/logwriterport.cpp 2008-09-24 18:10:21.000000000 +0200
@@ -71,11 +71,7 @@ LogWriterPort::LogWriterPort (mapOpen (_logFileName, false);
}
diff -Narup gearbox.old/src/flexiport/port.cpp gearbox/src/flexiport/port.cpp
--- gearbox.old/src/flexiport/port.cpp 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/port.cpp 2008-09-24 18:10:21.000000000 +0200
@@ -4,17 +4,17 @@
* Copyright (c) 2008 Geoffrey Biggs
*
* flexiport flexible hardware data communications library.
- *
- * This distribution is licensed to you under the terms described in the LICENSE file included in
+ *
+ * This distribution is licensed to you under the terms described in the LICENSE file included in
* this distribution.
*
* This work is a product of the National Institute of Advanced Industrial Science and Technology,
* Japan. Registration number: H20PRO-881
- *
+ *
* This file is part of flexiport.
*
* flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation, either version 3 of
+ * Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
@@ -73,7 +73,7 @@ ssize_t Port::ReadString (std::string &b
{
char *charBuffer = NULL;
ssize_t bytesAvailable = 0, numRead = 0;
-
+
buffer.clear ();
CheckPort (true);
@@ -86,17 +86,13 @@ ssize_t Port::ReadString (std::string &b
if (_debug >= 2)
{
- cerr << "Port::" << __func__ << "() Got " << bytesAvailable <<
+ cerr << "Port::" << __func__ << "() Got " << bytesAvailable <<
" bytes waiting to be read into a string" << endl;
}
// Read this many characters into a string - include space for a NULL incase one doesn't
// come in the transmitted data.
- if ((charBuffer = new char[bytesAvailable + 1]) == NULL)
- {
- throw PortException (string ("Port::") + __func__ +
- string ("() Failed to allocate temporary string storage."));
- }
+ charBuffer = new char[bytesAvailable + 1];
if ((numRead = Read (charBuffer, bytesAvailable)) < 0)
return -1; // Timeout
charBuffer[numRead] = '\0';
@@ -104,8 +100,8 @@ ssize_t Port::ReadString (std::string &b
if (numRead != bytesAvailable && _debug >= 1)
{
- cerr << "WARNING: Port::" << __func__ <<
- " Read different number of bytes than peek said were available: " <<
+ cerr << "WARNING: Port::" << __func__ <<
+ " Read different number of bytes than peek said were available: " <<
numRead << " != " << bytesAvailable << endl;
}
if (_debug >= 2)
@@ -125,7 +121,7 @@ ssize_t Port::ReadUntil (void * const bu
if (_debug >= 2)
{
- cerr << "Port::" << __func__ << "() Reading until '" << terminator << "' or " <<
+ cerr << "Port::" << __func__ << "() Reading until '" << terminator << "' or " <<
count << " bytes." << endl;
}
// Read bytes one at a time until either a timeout occurs, we hit the terminator byte, or
@@ -170,7 +166,7 @@ ssize_t Port::ReadStringUntil (std::stri
if (_debug >= 2)
{
- cerr << "Port::" << __func__ << "() Reading string until receive '" << terminator <<
+ cerr << "Port::" << __func__ << "() Reading string until receive '" << terminator <<
"'" << endl;
}
// Read bytes one at a time until either a timeout occurs or we hit the terminator byte
@@ -256,7 +252,7 @@ ssize_t Port::SkipUntil (uint8_t termina
if (_debug >= 2)
{
- cerr << "Port::" << __func__ << "() Skipping until '" << terminator << "' is seen " <<
+ cerr << "Port::" << __func__ << "() Skipping until '" << terminator << "' is seen " <<
count << " times." << endl;
}
// Read bytes one at a time until either a timeout occurs or we hit the terminator byte
@@ -309,15 +305,15 @@ ssize_t Port::WriteFull (const void * co
if (!IsOpen ())
{
stringstream ss;
- ss << "Port::" << __func__ << "() Port closed while trying to write " <<
+ ss << "Port::" << __func__ << "() Port closed while trying to write " <<
count << " bytes";
throw PortException (ss.str ());
}
// If it is open we can keep going, but with a warning
if (_debug >= 1)
{
- cerr << "WARNING: Port::" << __func__ <<
- " Port closed during WriteFull operation; data may be missing/corrupted." <<
+ cerr << "WARNING: Port::" << __func__ <<
+ " Port closed during WriteFull operation; data may be missing/corrupted." <<
endl;
}
}
@@ -342,7 +338,7 @@ ssize_t Port::WriteString (const char *
return -1; // Timeout
if (numWritten < numToWrite && _debug >= 1)
{
- cerr << "WARNING: Port::" << __func__ << "() Did not write whole string; only wrote " <<
+ cerr << "WARNING: Port::" << __func__ << "() Did not write whole string; only wrote " <<
numWritten << " of " << numToWrite << " bytes" << endl;
}
diff -Narup gearbox.old/src/flexiport/port.h gearbox/src/flexiport/port.h
--- gearbox.old/src/flexiport/port.h 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/port.h 2008-09-24 18:10:21.000000000 +0200
@@ -4,17 +4,17 @@
* Copyright (c) 2008 Geoffrey Biggs
*
* flexiport flexible hardware data communications library.
- *
- * This distribution is licensed to you under the terms described in the LICENSE file included in
+ *
+ * This distribution is licensed to you under the terms described in the LICENSE file included in
* this distribution.
*
* This work is a product of the National Institute of Advanced Industrial Science and Technology,
* Japan. Registration number: H20PRO-881
- *
+ *
* This file is part of flexiport.
*
* flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation, either version 3 of
+ * Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
@@ -154,7 +154,7 @@ class FLEXIPORT_EXPORT Port
/** @brief Read a new-line terminated string of data.
A convenience function that reads until a newline character (\\n, 0x0A) is received and
- stores the received data in a caller-provided buffer, @ref buffer. Good for text-based
+ stores the received data in a caller-provided buffer, @ref buffer. Good for text-based
protocols that use newlines as message terminators. Will not read more than @ref count
bytes.
@@ -166,10 +166,10 @@ class FLEXIPORT_EXPORT Port
strlen ()).
@note This function makes many calls to Read, each of which has an individual timeout. The
- maximum length of time this function make take may therefore be longer than one timeout.
+ maximum length of time this function may take may therefore be longer than one timeout.
@note If the port is set to non-blocking mode (by setting the timeout to zero), this will
- effectively timeout immediatly when there is no data available, returning -1 irrespective of
+ effectively timeout immediately when there is no data available, returning -1 irrespective of
the quantity of data actually received before that point.
@return The length of the string (including the new line), or -1 if a timeout occured. */
@@ -180,7 +180,7 @@ class FLEXIPORT_EXPORT Port
A convenience function that reads until a newline character (\\n, 0x0A) is received and
stores the received data in a string, @buffer. Good for text-based protocols that use
newlines as message terminators.
-
+
@note This function makes many calls to Read, each of which has an individual timeout. The
maximum length of time this function make take may therefore be longer than one timeout.
@@ -268,7 +268,7 @@ class FLEXIPORT_EXPORT Port
/** @brief Set the timeout value. Set seconds to -1 to disable timeouts and block forever.
@note On Mac OS X, the timer is reset each time data is received, making the timeout an
- inactivity timer in that there must be no data at all for the length of the timeout for it
+ inactivity timer in that there must be no data at all for the length of the timeout for it
to trigger. This can potentially lead to very long blocking if the sender is sending data
slightly faster than the timeout. */
virtual void SetTimeout (Timeout timeout) = 0;
diff -Narup gearbox.old/src/flexiport/timeout.h gearbox/src/flexiport/timeout.h
--- gearbox.old/src/flexiport/timeout.h 2008-07-25 14:15:09.000000000 +0200
+++ gearbox/src/flexiport/timeout.h 2008-09-24 18:10:21.000000000 +0200
@@ -4,17 +4,17 @@
* Copyright (c) 2008 Geoffrey Biggs
*
* flexiport flexible hardware data communications library.
- *
- * This distribution is licensed to you under the terms described in the LICENSE file included in
+ *
+ * This distribution is licensed to you under the terms described in the LICENSE file included in
* this distribution.
*
* This work is a product of the National Institute of Advanced Industrial Science and Technology,
* Japan. Registration number: H20PRO-881
- *
+ *
* This file is part of flexiport.
*
* flexiport is free software: you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation, either version 3 of
+ * Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* flexiport is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
@@ -28,9 +28,6 @@
#ifndef __TIMEOUT_H
#define __TIMEOUT_H
-#include