Imported Upstream version 1.5.1 upstream
authorThibaut GRIDEL <tgridel@free.fr>
Wed, 15 Dec 2010 13:52:11 +0000 (14:52 +0100)
committerThibaut GRIDEL <tgridel@free.fr>
Wed, 15 Dec 2010 13:52:11 +0000 (14:52 +0100)
22 files changed:
ChangeLog
doc/NEWS.txt
doc/README.txt
doc/USAGE.txt
doc/html/configuration.html
doc/html/readme.html [new file with mode: 0644]
doc/html/usage.html
src/Makefile
src/files.c
src/logging.c [new file with mode: 0644]
src/logging.h [new file with mode: 0644]
src/nodesx.c
src/optimiser.c
src/osmparser.c
src/planetsplitter.c
src/relationsx.c
src/router.c
src/segmentsx.c
src/superx.c
src/tagmodifier.c
src/waysx.c
xml/routino-translations.xml

index d013a33..cfa3313 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2010-11-13  Andrew M. Bishop  <amb@gedanken.demon.co.uk>
+
+       Version 1.5.1 released
+
+2010-11-13  Andrew M. Bishop  <amb@gedanken.demon.co.uk>
+
+       * doc/NEWS.txt, doc/README.txt: Updated for version 1.5.1.
+
+       * doc/USAGE.txt: Update program usage for new logging option.
+
+       * xml/routino-translations.xml:
+       Add translation for ferry into German (patch from Michael Günnewig).
+
+       * src/relationsx.c: Fix bug with relation processing.
+
+       * src/logging.h: Add GCC attributes for the logging functions.
+
+       * src/logging.h, src/logging.c: New file.
+
+       * src/Makefile, src/nodesx.c, src/optimiser.c, src/osmparser.c, src/planetsplitter.c,
+       src/relationsx.c, src/router.c, src/segmentsx.c, src/superx.c, src/tagmodifier.c,
+       src/waysx.c:
+       Add an option to make the output more suitable for a log file.
+
+2010-10-31  Andrew M. Bishop  <amb@gedanken.demon.co.uk>
+
+       * src/files.c:
+       Ensure that enough memory gets allocated in FileName() function.
+
 2010-10-30  Andrew M. Bishop  <amb@gedanken.demon.co.uk>
 
        Version 1.5 released
index 51071ba..42bfc92 100644 (file)
@@ -1,3 +1,20 @@
+Version 1.5.1 of Routino released : Sat Nov 13 2010
+---------------------------------------------------
+
+Bug fixes:
+  Ensure that enough memory is allocated for filenames.
+  Fix bug that sometimes causes crash when processing route relations.
+
+Documentation:
+  Update documentation to reflect changes in program usage and function.
+
+Programs:
+  Add an option to make the output more suitable for a log file.
+
+Documentation:
+  Update documentation to reflect changes in program usage.
+
+
 Version 1.5 of Routino released : Sat Oct 30 2010
 -------------------------------------------------
 
index 9a6e336..875c02e 100644 (file)
@@ -104,6 +104,7 @@ Status
    Version 1.4 of Routino was released on 31st May 2010.
    Version 1.4.1 of Routino was released on 10th July 2010.
    Version 1.5 of Routino was released on 30th October 2010.
+   Version 1.5.1 of Routino was released on 13th November 2010.
 
    The full version history is available in the NEWS.txt file.
 
index 402810f..fd8be31 100644 (file)
@@ -22,6 +22,7 @@ planetsplitter
                         [--sort-ram-size=<size>]
                         [--tmpdir=<dirname>]
                         [--parse-only | --process-only]
+                        [--loggable]
                         [--max-iterations=<number>]
                         [--tagging=<filename>]
                         [<filename.osm> ...]
@@ -55,6 +56,11 @@ planetsplitter
           Don't read in any files but process the existing temporary file
           into the routing database.
 
+   --loggable
+          Print progress messages that are suitable for logging to a file;
+          normally an incrementing counter is printed which is more
+          suitable for realtime display than logging.
+
    --max-iterations=<number>
           The maximum number of iterations to use when generating
           super-nodes and super-segments. Defaults to 10 which is normally
@@ -105,7 +111,7 @@ router
                 [--dir=<dirname>] [--prefix=<name>]
                 [--profiles=<filename>] [--translations=<filename>]
                 [--exact-nodes-only]
-                [--quiet]
+                [--loggable | --quiet]
                 [--output-html]
                 [--output-gpx-track] [--output-gpx-route]
                 [--output-text] [--output-text-all]
@@ -171,6 +177,11 @@ router
           within a segment (quicker but less accurate unless the points
           are already near nodes).
 
+   --loggable
+          Print progress messages that are suitable for logging to a file;
+          normally an incrementing counter is printed which is more
+          suitable for realtime display than logging.
+
    --quiet
           Don't generate any screen output while running (useful for
           running in a script).
@@ -427,12 +438,18 @@ tagmodifier
    XML file for test purposes.
 
    Usage: tagmodifier [--help]
+                      [--loggable]
                       [--tagging=<filename>]
                       [<filename.osm>]
 
    --help
           Prints out the help information.
 
+   --loggable
+          Print progress messages that are suitable for logging to a file;
+          normally an incrementing counter is printed which is more
+          suitable for realtime display than logging.
+
    --tagging=<filename>
           The name of the XML file containing the tagging rules (defaults
           to 'tagging.xml' in the current directory).
index 6acc522..2f3ac77 100644 (file)
@@ -171,8 +171,7 @@ foot is shown below:
       &lt;property type="multilane"    percent="25" /&gt;
       &lt;property type="bridge"       percent="50" /&gt;
       &lt;property type="tunnel"       percent="50" /&gt;
-      &lt;property type="footroute"    percent="55" /&gt;
-      &lt;property type="bicycleroute" percent="55" /&gt;
+...
     &lt;/properties&gt;
     &lt;restrictions&gt;
       &lt;oneway obey="0" /&gt; 
diff --git a/doc/html/readme.html b/doc/html/readme.html
new file mode 100644 (file)
index 0000000..8dd0712
--- /dev/null
@@ -0,0 +1,276 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+
+<!--
+ Routino documentation - algorithm
+
+ Part of the Routino routing software.
+
+ This file Copyright 2008-2010 Andrew M. Bishop
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see http://www.gnu.org/licenses/.
+-->
+
+<HEAD>
+<TITLE>Routino : Software</TITLE>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<LINK href="style.css" type="text/css" rel="stylesheet">
+</HEAD>
+
+<BODY>
+
+<!-- Header Start -->
+
+<div class="header" align="center">
+
+<h1>Routino : Software</h1>
+
+<hr>
+</div>
+
+<!-- Header End -->
+
+<!-- Content Start -->
+
+<div class="content">
+
+<h2><a name="H_1_1" title="Introduction"></a>Routino Introduction</h2>
+
+Routino is an application for finding a route between two points using the
+dataset of topographical information collected by
+<a class="ext" title="OpenStreetMap" href="http://www.openstreetmap.org/">http://www.OpenStreetMap.org</a>.
+
+<p>
+
+Starting from the raw OpenStreetMap data (in the form of the '.osm' XML files
+available on the internet) a custom database is generated that contains the
+information useful for routing.  With this database and two points specified by
+latitude and longitude an optimum route (either shortest or quickest) is
+determined.  The route is calculated for OpenStreetMap highways (roads, paths
+etc) using one of the common forms of transport defined in OpenStreetMap (foot,
+bicycle, horse, motorcar, motorbike etc).
+
+<p>
+
+When processing the OpenStreetMap data the types of highways are recorded and
+these set default limits on the types of traffic allowed.  More specific
+information about permissions for different types of transport are also recorded
+as are maximum speed limits.  Further restrictions like oneway streets, weight,
+height, width and length limits are also included where specified. Additionally
+a set of properties of each highway are also recorded.  The processing of the
+input file is controlled by a configuration file which determines the
+information that is used.
+
+<p>
+
+When calculating a route the type of transport to be used is taken into account
+to ensure that the known restrictions are followed.  Each of the different
+highway types can further be allowed or disallowed depending on preferences.
+For each type of highway a default speed limit is defined (although the actual
+speed used will be the lowest of the default and any specified in the original
+data).  To make use of the information about restrictions the weight, height,
+width and length of the transport can also be specified.  Further preferences
+about road properties (e.g. paved or not) can also be selected.
+
+<p>
+
+The result of calculating the route can be presented in several different ways.
+An HTML file can be produced that contains a description of the route to take
+with instructions for each of the important junctions.  The contents of the file
+are created based on a set of translations specified in a configuration file.
+The route is also available in a
+<a class="ext" title="GPX format" href="http://www.topografix.com/gpx.asp">GPX (GPS eXchange) XML format</a>.
+format file containing either every point and highway segment (a track file) or
+just a waypoint and translated instructions for the important junctions (a route
+file).
+Additionally there are two plain text files that contain all data points or just
+the important ones (intended for debugging and further processing).
+
+<p>
+
+One of the design aims of Routino was to make the software are flexible as
+possible in selecting routing preferences but also have a sensible set of
+default values.  Another design aim was that finding the optimum route should be
+very fast and most of the speed increases come from the carefully chosen and
+optimised data format.
+
+
+<h2><a name="H_1_2"></a>Disclaimer</h2>
+
+The route that is calculated by this software is only as good as the input data.
+
+<p>
+
+Routino comes with ABSOLUTELY NO WARRANTY for the software itself or the route
+that is calculated by it.
+
+
+<h2><a name="H_1_3"></a>Demonstration</h2>
+
+A live demonstration of the router for the UK is available on the internet:
+<br>
+<a title="Routino demo" href="http://www.routino.org/uk/">http://www.routino.org/uk/</a>
+
+<p>
+
+The source code download available below also includes a set of files that can
+be used to create your own interactive map.
+
+<p>
+
+The interactive map is made possible by use of the OpenLayers Javascript
+library from <a class="ext" href="http://www.openlayers.org" title="OpenLayers">http://www.openlayers.org/</a>.
+
+
+<h2><a name="H_1_4"></a>Documentation</h2>
+
+A full set of
+<a href="index.html" title="Documentation">documentation</a>
+is available that describes how to install and use the programs as well as
+what should go in the configuration files and how it works.
+
+
+<h2><a name="H_1_5"></a>Status</h2>
+
+Version 1.0 of Routino was released on 8th April 2009.
+<br>
+Version 1.1 of Routino was released on 13th June 2009.
+<br>
+Version 1.2 of Routino was released on 21st October 2009.
+<br>
+Version 1.3 of Routino was released on 21st January 2010.
+<br>
+Version 1.4 of Routino was released on 31st May 2010.
+<br>
+Version 1.4.1 of Routino was released on 10th July 2010.
+<br>
+Version 1.5 of Routino was released on 30th October 2010.
+<br>
+Version 1.5.1 of Routino was released on 13th November 2010.
+
+<p>
+
+The full version history is available in the NEWS file.
+
+
+<h3><a name="H_1_5_1" title="Changes"></a>Changes in Version 1.5</h3>
+
+<dl>
+  <dt>Bug fixes:
+  <dd>Check that number of nodes/segments/ways doesn't exceed numerical limits.
+  <br>Allow 32-bit systems to seek within files larger than 4GB.
+  <br>Allow nearly 4G nodes to be stored instead of 2G before.
+  <br>Added rules to makefile for installation (paths specified in top-level).
+  <br>Stricter checking of UTF-8 in XML files and better UTF-8 output.
+  <br>Improve error message if parsing of command line options fail.
+  <br>Fix bugs in router's --help-profile-json and --help-profile-perl options.
+  <br>Rename heapsort function to allow compilation on Mac OS with no change.
+  <br>Reduce impact of property preferences close to 50% by using sqrt().
+
+  <dt>Documentation:
+  <dd>Update documentation to reflect changes in program usage and function.
+
+  <dt>OSM tagging
+  <dd>Traffic restrictions on nodes are now included in default tagging file.
+  <br>Added processing for ferry routes (as pseudo-highway type 'ferry').
+  <br>Process foot and bicycle route relations to create new properties.
+
+  <dt>Configuration Files:
+  <dd>Added Dutch output translations.
+  <br>Added ferry information to profiles.
+  <br>Added foot and bicycle route relation processing.
+
+  <dt>planetsplitter
+  <dd>The slim mode now includes the output data as well as the temporary data.
+  <br>The slim mode is now a separate executable and not a command line option.
+  <br>Traffic restrictions on nodes are now understood when parsing OSM files.
+  <br>Falls back to installed tagging.xml configuration file as last resort.
+
+  <dt>router:
+  <dd>Added a slim mode (as a separate executable and not a command line option).
+  <br>Traffic will not be routed through a node that does not allow it.
+  <br>Falls back to installed profiles.xml & translations.xml files as last resort.
+
+  <dt>filedumper:
+  <dd>Added a slim mode (as a separate executable and not a command line option).
+
+  <dt>Web pages:
+  <dd>Added Dutch translation of router.html.
+</dl>
+
+<h3><a name="H_1_5_2"></a>Additional Changes in Version 1.5.1</h3>
+
+<dl>
+  <dt>Bug fixes:
+  <dd>Ensure that enough memory is allocated for filenames.
+  <br>Fix bug that sometimes causes crash when processing route relations.
+
+  <dt>Documentation:
+  <dd>Update documentation to reflect changes in program usage and function.
+
+  <dt>Programs:
+  <dd>Add an option to make the output more suitable for a log file.
+
+  <dt>Documentation:
+  <dd>Update documentation to reflect changes in program usage.
+</dl>
+
+
+<h3><a name="H_1_5_3"></a>License</h3>
+
+This program is free software: you can redistribute it and/or modify it under
+the terms of the
+<a class="ext" title="Affero GPLv3" href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">GNU Affero General Public License</a>
+as published by the Free Software Foundation; either version 3 of the License,
+or (at your option) any later version.
+
+<p>
+
+It is important to note that for this program I have decided to use the
+<em>Affero GPLv3</em> instead of just using the GPL.  This license adds
+additional requirements to anybody who provides a networked service using this
+software.
+
+
+<h3><a name="H_1_5_4"></a>Copyright</h3>
+
+Routino is copyright Andrew M. Bishop 2008-2010.
+
+
+<h2><a name="H_1_6"></a>Download</h2>
+
+The <a title="Download directory" href="http://www.routino.org/download/">download directory</a>
+contains the latest version of the source code.
+
+
+</div>
+
+<!-- Content End -->
+
+<!-- Footer Start -->
+
+<div class="footer" align="center">
+<hr>
+
+<address>
+&copy; Andrew M. Bishop = &lt;amb "at" gedanken.demon.co.uk&gt;
+</address>
+
+</div>
+
+<!-- Footer End -->
+
+</BODY>
+
+</HTML>
index 74e33f7..873a5c3 100644 (file)
@@ -65,6 +65,7 @@ Usage: planetsplitter [--help]
                       [--sort-ram-size=&lt;size&gt;]
                       [--tmpdir=&lt;dirname&gt;]
                       [--parse-only | --process-only]
+                      [--loggable]
                       [--max-iterations=&lt;number&gt;]
                       [--tagging=&lt;filename&gt;]
                       [&lt;filename.osm&gt; ...]
@@ -92,6 +93,10 @@ Usage: planetsplitter [--help]
   <dt>--process-only
   <dd>Don't read in any files but process the existing temporary file into the
     routing database.
+  <dt>--loggable
+  <dd>Print progress messages that are suitable for logging to a file; normally
+    an incrementing counter is printed which is more suitable for realtime
+    display than logging.
   <dt>--max-iterations=&lt;number&gt;
   <dd>The maximum number of iterations to use when generating super-nodes and
     super-segments.  Defaults to 10 which is normally enough.
@@ -142,7 +147,7 @@ Usage: router [--help | --help-profile | --help-profile-xml |
               [--dir=&lt;dirname&gt;] [--prefix=&lt;name&gt;]
               [--profiles=&lt;filename&gt;] [--translations=&lt;filename&gt;]
               [--exact-nodes-only]
-              [--quiet]
+              [--loggable | --quiet]
               [--output-html]
               [--output-gpx-track] [--output-gpx-route]
               [--output-text] [--output-text-all]
@@ -198,6 +203,10 @@ Usage: router [--help | --help-profile | --help-profile-xml |
   <dd>When processing the specified latitude and longitude points only select
     the nearest node instead of finding the nearest point within a segment
     (quicker but less accurate unless the points are already near nodes).
+  <dt>--loggable
+  <dd>Print progress messages that are suitable for logging to a file; normally
+    an incrementing counter is printed which is more suitable for realtime
+    display than logging.
   <dt>--quiet
   <dd>Don't generate any screen output while running (useful for running in a script).
   <dt>--language=&lt;lang&gt;
@@ -263,6 +272,7 @@ Usage: router [--help | --help-profile | --help-profile-xml |
       <li>cycleway     = Cycleway
       <li>path         = Path
       <li>steps        = Steps
+      <li>ferry        = Ferry
     </ul>
     Default value depends on the profile selected by the --transport option.
   <dt>--speed-&lt;highway&gt;=&lt;speed&gt;
@@ -429,6 +439,7 @@ for test purposes.
 
 <pre class="boxed">
 Usage: tagmodifier [--help]
+                   [--loggable]
                    [--tagging=&lt;filename&gt;]
                    [&lt;filename.osm&gt;]
 </pre>
@@ -436,6 +447,10 @@ Usage: tagmodifier [--help]
 <dl>
   <dt>--help
   <dd>Prints out the help information.
+  <dt>--loggable
+  <dd>Print progress messages that are suitable for logging to a file; normally
+    an incrementing counter is printed which is more suitable for realtime
+    display than logging.
   <dt>--tagging=&lt;filename&gt;
   <dd>The name of the XML file containing the tagging rules (defaults to
     'tagging.xml' in the current directory).
index 81332d4..76a4ea8 100644 (file)
@@ -1,4 +1,4 @@
-# $Header: /home/amb/routino/src/RCS/Makefile,v 1.42 2010/09/17 17:42:20 amb Exp $
+# $Header: /home/amb/routino/src/RCS/Makefile,v 1.43 2010/11/13 14:22:28 amb Exp $
 #
 # Source code Makefile
 #
@@ -38,7 +38,7 @@ CFLAGS=-Wall -Wmissing-prototypes
 LDFLAGS=-lm -lc
 
 CFLAGS+= -O3
-CFLAGS+= -O0 -g
+#CFLAGS+= -O0 -g
 #CFLAGS+= -pg
 #CFLAGS+= --coverage
 
@@ -76,7 +76,7 @@ all : $(EXE)
 PLANETSPLITTER_OBJ=planetsplitter.o \
                   nodesx.o segmentsx.o waysx.o relationsx.o superx.o \
                   ways.o types.o \
-                  files.o \
+                  files.o logging.o \
                   results.o queue.o sorting.o \
                   xmlparse.o tagging.o osmparser.o
 
@@ -88,7 +88,7 @@ planetsplitter : $(PLANETSPLITTER_OBJ)
 PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \
                        nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o \
                        ways.o types.o \
-                       files.o \
+                       files.o logging.o \
                        results.o queue.o sorting.o \
                        xmlparse.o tagging.o osmparser.o
 
@@ -100,7 +100,7 @@ planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ)
 ROUTER_OBJ=router.o \
           nodes.o segments.o ways.o types.o fakes.o \
           optimiser.o output.o \
-          files.o profiles.o xmlparse.o \
+          files.o logging.o profiles.o xmlparse.o \
           results.o queue.o translations.o
 
 router : $(ROUTER_OBJ)
@@ -111,7 +111,7 @@ router : $(ROUTER_OBJ)
 ROUTER_SLIM_OBJ=router-slim.o \
                nodes-slim.o segments-slim.o ways-slim.o types.o fakes.o \
                optimiser-slim.o output-slim.o \
-               files.o profiles.o xmlparse.o \
+               files.o logging.o profiles.o xmlparse.o \
                results.o queue.o translations.o
 
 router-slim : $(ROUTER_SLIM_OBJ)
@@ -122,7 +122,7 @@ router-slim : $(ROUTER_SLIM_OBJ)
 FILEDUMPER_OBJ=filedumper.o \
               nodes.o segments.o ways.o types.o \
                visualiser.o \
-              files.o xmlparse.o
+              files.o logging.o xmlparse.o
 
 filedumper : $(FILEDUMPER_OBJ)
        $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS)
@@ -132,7 +132,7 @@ filedumper : $(FILEDUMPER_OBJ)
 FILEDUMPER_SLIM_OBJ=filedumper-slim.o \
               nodes-slim.o segments-slim.o ways-slim.o types.o \
                visualiser-slim.o \
-              files.o xmlparse.o
+              files.o logging.o xmlparse.o
 
 filedumper-slim : $(FILEDUMPER_SLIM_OBJ)
        $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS)
@@ -140,7 +140,7 @@ filedumper-slim : $(FILEDUMPER_SLIM_OBJ)
 ########
 
 TAGMODIFIER_OBJ=tagmodifier.o \
-               files.o \
+               files.o logging.o \
                 xmlparse.o tagging.o
 
 tagmodifier : $(TAGMODIFIER_OBJ)
index 8e54025..fc42a27 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/files.c,v 1.24 2010/10/16 10:59:18 amb Exp $
+ $Header: /home/amb/routino/src/RCS/files.c,v 1.25 2010/10/31 17:52:40 amb Exp $
 
  Functions to handle files.
 
@@ -66,7 +66,7 @@ static int nmappedfiles=0;
 
 char *FileName(const char *dirname,const char *prefix, const char *name)
 {
- char *filename=(char*)malloc((dirname?strlen(dirname):0)+1+(prefix?strlen(prefix):0)+1+strlen(name));
+ char *filename=(char*)malloc((dirname?strlen(dirname):0)+1+(prefix?strlen(prefix):0)+1+strlen(name)+1);
 
  sprintf(filename,"%s%s%s%s%s",dirname?dirname:"",dirname?"/":"",prefix?prefix:"",prefix?"-":"",name);
 
diff --git a/src/logging.c b/src/logging.c
new file mode 100644 (file)
index 0000000..bb43c07
--- /dev/null
@@ -0,0 +1,253 @@
+/***************************************
+ $Header: /home/amb/routino/src/RCS/logging.c,v 1.1 2010/11/13 14:22:40 amb Exp $
+
+ Functions to handle logging functions.
+
+ Part of the Routino routing software.
+ ******************/ /******************
+ This file Copyright 2008-2010 Andrew M. Bishop
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ ***************************************/
+
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "logging.h"
+
+
+/*+ The option to print the output in a way that allows logging to a file. +*/
+int option_loggable=0;
+
+
+/* Local functions */
+
+static void vfprintf_first(FILE *file,const char *format,va_list ap);
+static void vfprintf_middle(FILE *file,const char *format,va_list ap);
+static void vfprintf_last(FILE *file,const char *format,va_list ap);
+
+/* Local variables */
+
+static int printed_length=0;
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the first message in an overwriting sequence.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void printf_first(const char *format, ...)
+{
+ va_list ap;
+
+ if(option_loggable)
+    return;
+
+ va_start(ap,format);
+
+ vfprintf_first(stdout,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the middle message in an overwriting sequence.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void printf_middle(const char *format, ...)
+{
+ va_list ap;
+
+ if(option_loggable)
+    return;
+
+ va_start(ap,format);
+
+ vfprintf_middle(stdout,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the last message in an overwriting sequence.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void printf_last(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap,format);
+
+ vfprintf_last(stdout,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the first message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void fprintf_first(FILE *file,const char *format, ...)
+{
+ va_list ap;
+
+ if(option_loggable)
+    return;
+
+ va_start(ap,format);
+
+ vfprintf_first(file,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the middle message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void fprintf_middle(FILE *file,const char *format, ...)
+{
+ va_list ap;
+
+ if(option_loggable)
+    return;
+
+ va_start(ap,format);
+
+ vfprintf_middle(file,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the last message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  ... The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+void fprintf_last(FILE *file,const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap,format);
+
+ vfprintf_last(file,format,ap);
+
+ va_end(ap);
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the first message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  va_list ap The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+static void vfprintf_first(FILE *file,const char *format,va_list ap)
+{
+ int retval;
+
+ retval=vfprintf(file,format,ap);
+ fflush(file);
+
+ if(retval>0)
+    printed_length=retval;
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the middle message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  va_list ap The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+static void vfprintf_middle(FILE *file,const char *format,va_list ap)
+{
+ int retval;
+
+ putchar('\r');
+ retval=vfprintf(file,format,ap);
+ fflush(file);
+
+ if(retval>0)
+    printed_length=retval;
+}
+
+
+/*++++++++++++++++++++++++++++++++++++++
+  Print the last message in an overwriting sequence.
+
+  FILE *file The file to write to.
+
+  const char *format The format string.
+
+  va_list ap The other arguments.
+  ++++++++++++++++++++++++++++++++++++++*/
+
+static void vfprintf_last(FILE *file,const char *format,va_list ap)
+{
+ int retval;
+
+ if(!option_loggable)
+    putchar('\r');
+ retval=vfprintf(file,format,ap);
+
+ if(retval>0)
+    while(retval++<printed_length)
+       putchar(' ');
+
+ putchar('\n');
+ fflush(file);
+}
diff --git a/src/logging.h b/src/logging.h
new file mode 100644 (file)
index 0000000..e3fe945
--- /dev/null
@@ -0,0 +1,61 @@
+/***************************************
+ $Header: /home/amb/routino/src/RCS/logging.h,v 1.2 2010/11/13 14:50:33 amb Exp $
+
+ Header file for logging function prototypes
+
+ Part of the Routino routing software.
+ ******************/ /******************
+ This file Copyright 2008-2010 Andrew M. Bishop
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ ***************************************/
+
+
+#ifndef LOGGING_H
+#define LOGGING_H    /*+ To stop multiple inclusions. +*/
+
+#include <stdio.h>
+
+
+/* Variables */
+
+extern int option_loggable;
+
+
+/* In logging.c */
+
+#ifdef __GNUC__
+
+void printf_first(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+void printf_middle(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+void printf_last(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+
+void fprintf_first(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+void fprintf_middle(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+void fprintf_last(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+
+#else
+
+void printf_first(const char *format, ...);
+void printf_middle(const char *format, ...);
+void printf_last(const char *format, ...);
+
+void fprintf_first(FILE *file,const char *format, ...);
+void fprintf_middle(FILE *file,const char *format, ...);
+void fprintf_last(FILE *file,const char *format, ...);
+
+#endif
+
+
+#endif /* LOGGING_H */
index e5f0ae8..257a589 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/nodesx.c,v 1.75 2010/10/09 14:14:42 amb Exp $
+ $Header: /home/amb/routino/src/RCS/nodesx.c,v 1.76 2010/11/13 14:22:28 amb Exp $
 
  Extented Node data type functions.
 
@@ -39,6 +39,7 @@
 #include "types.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 
 
@@ -187,8 +188,7 @@ void SortNodeList(NodesX* nodesx)
 
  /* Print the start message */
 
- printf("Sorting Nodes");
- fflush(stdout);
+ printf_first("Sorting Nodes");
 
  /* Close the files and re-open them (finished appending) */
 
@@ -220,8 +220,7 @@ void SortNodeList(NodesX* nodesx)
 
  /* Print the final message */
 
- printf("\rSorted Nodes: Nodes=%d Duplicates=%d\n",nodesx->xnumber,nodesx->xnumber-nodesx->number);
- fflush(stdout);
+ printf_last("Sorted Nodes: Nodes=%d Duplicates=%d",nodesx->xnumber,nodesx->xnumber-nodesx->number);
 }
 
 
@@ -286,8 +285,7 @@ void SortNodeListGeographically(NodesX* nodesx)
 
  /* Print the start message */
 
- printf("Sorting Nodes Geographically");
- fflush(stdout);
+ printf_first("Sorting Nodes Geographically");
 
  /* Allocate the memory for the geographical offsets array */
 
@@ -324,8 +322,7 @@ void SortNodeListGeographically(NodesX* nodesx)
 
  /* Print the final message */
 
- printf("\rSorted Nodes Geographically \n");
- fflush(stdout);
+ printf_last("Sorted Nodes Geographically");
 }
 
 
@@ -480,8 +477,7 @@ void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the start message */
 
- printf("Checking: Nodes=0");
- fflush(stdout);
+ printf_first("Checking: Nodes=0");
 
  /* While we are here we can work out the range of data */
 
@@ -523,10 +519,7 @@ void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx)
     total++;
 
     if(!(total%10000))
-      {
-       printf("\rChecking: Nodes=%d Highway=%d not-Highway=%d",total,highway,nothighway);
-       fflush(stdout);
-      }
+       printf_middle("Checking: Nodes=%d Highway=%d not-Highway=%d",total,highway,nothighway);
    }
 
  /* Close the files and re-open them */
@@ -559,8 +552,7 @@ void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the final message */
 
- printf("\rChecked: Nodes=%d Highway=%d not-Highway=%d  \n",total,highway,nothighway);
- fflush(stdout);
+ printf_last("Checked: Nodes=%d Highway=%d not-Highway=%d",total,highway,nothighway);
 }
 
 
@@ -578,8 +570,7 @@ void CreateRealNodes(NodesX *nodesx,int iteration)
 
  /* Print the start message */
 
- printf("Creating Real Nodes: Nodes=0");
- fflush(stdout);
+ printf_first("Creating Real Nodes: Nodes=0");
 
  /* Map into memory */
 
@@ -618,10 +609,7 @@ void CreateRealNodes(NodesX *nodesx,int iteration)
 #endif
 
     if(!((i+1)%10000))
-      {
-       printf("\rCreating Real Nodes: Nodes=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Creating Real Nodes: Nodes=%d",i+1);
    }
 
  /* Free the unneeded memory */
@@ -637,8 +625,7 @@ void CreateRealNodes(NodesX *nodesx,int iteration)
 
  /* Print the final message */
 
- printf("\rCreating Real Nodes: Nodes=%d \n",nodesx->number);
- fflush(stdout);
+ printf_last("Creating Real Nodes: Nodes=%d",nodesx->number);
 }
 
 
@@ -659,8 +646,7 @@ void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the start message */
 
- printf("Indexing Segments: Segments=0");
- fflush(stdout);
+ printf_first("Indexing Segments: Segments=0");
 
  /* Map into memory */
 
@@ -782,10 +768,7 @@ void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx)
       }
 
     if(!((i+1)%10000))
-      {
-       printf("\rIndexing Segments: Segments=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Indexing Segments: Segments=%d",i+1);
    }
 
  /* Unmap from memory */
@@ -797,8 +780,7 @@ void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the final message */
 
- printf("\rIndexed Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Indexed Segments: Segments=%d ",segmentsx->number);
 }
 
 
@@ -819,8 +801,7 @@ void SaveNodeList(NodesX* nodesx,const char *filename)
 
  /* Print the start message */
 
- printf("Writing Nodes: Nodes=0");
- fflush(stdout);
+ printf_first("Writing Nodes: Nodes=0");
 
  /* Map into memory */
 
@@ -846,10 +827,7 @@ void SaveNodeList(NodesX* nodesx,const char *filename)
     WriteFile(fd,node,sizeof(Node));
 
     if(!((i+1)%10000))
-      {
-       printf("\rWriting Nodes: Nodes=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Writing Nodes: Nodes=%d",i+1);
    }
 
  /* Write out the header structure */
@@ -876,6 +854,5 @@ void SaveNodeList(NodesX* nodesx,const char *filename)
 
  /* Print the final message */
 
- printf("\rWrote Nodes: Nodes=%d  \n",nodesx->number);
- fflush(stdout);
+ printf_last("Wrote Nodes: Nodes=%d",nodesx->number);
 }
index 55b4b32..d66ed44 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/optimiser.c,v 1.93 2010/08/04 16:44:51 amb Exp $
+ $Header: /home/amb/routino/src/RCS/optimiser.c,v 1.94 2010/11/13 14:22:28 amb Exp $
 
  Routing optimiser.
 
@@ -29,6 +29,7 @@
 #include "segments.h"
 #include "ways.h"
 
+#include "logging.h"
 #include "functions.h"
 #include "results.h"
 
@@ -285,10 +286,7 @@ Results *FindMiddleRoute(Nodes *nodes,Segments *segments,Ways *ways,Results *beg
  Way     *way;
 
  if(!option_quiet)
-   {
-    printf("Routing: Super-Nodes checked = 0");
-    fflush(stdout);
-   }
+    printf_first("Routing: Super-Nodes checked = 0");
 
  /* Set up the finish conditions */
 
@@ -479,20 +477,14 @@ Results *FindMiddleRoute(Nodes *nodes,Segments *segments,Ways *ways,Results *beg
       endloop:
 
        if(!option_quiet && !(results->number%10000))
-         {
-          printf("\rRouting: Super-Nodes checked = %d",results->number);
-          fflush(stdout);
-         }
+          printf_middle("Routing: Super-Nodes checked = %d",results->number);
 
        segment=NextSegment(segments,segment,node1);
       }
    }
 
  if(!option_quiet)
-   {
-    printf("\rRouting: Super-Nodes checked = %d\n",results->number);
-    fflush(stdout);
-   }
+    printf_last("Routing: Super-Nodes checked = %d",results->number);
 
  /* Finish off the end part of the route. */
 
index f8b47a9..03e17b7 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/osmparser.c,v 1.72 2010/09/25 18:47:32 amb Exp $
+ $Header: /home/amb/routino/src/RCS/osmparser.c,v 1.73 2010/11/13 14:22:28 amb Exp $
 
  OSM XML file parser (either JOSM or planet)
 
@@ -38,6 +38,8 @@
 #include "xmlparse.h"
 #include "tagging.h"
 
+#include "logging.h"
+
 
 /* Macros */
 
@@ -252,10 +254,7 @@ static int nodeType_function(const char *_tag_,int _type_,const char *id,const c
     nnodes++;
 
     if(!(nnodes%1000))
-      {
-       printf("\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
-       fflush(stdout);
-      }
+       printf_middle("Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
 
@@ -387,10 +386,7 @@ static int wayType_function(const char *_tag_,int _type_,const char *id)
     nways++;
 
     if(!(nways%1000))
-      {
-       printf("\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
-       fflush(stdout);
-      }
+       printf_middle("Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
 
@@ -436,10 +432,7 @@ static int relationType_function(const char *_tag_,int _type_,const char *id)
     nrelations++;
 
     if(!(nrelations%1000))
-      {
-       printf("\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
-       fflush(stdout);
-      }
+       printf_middle("Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
 
@@ -537,13 +530,11 @@ int ParseOSM(FILE *file,NodesX *OSMNodes,SegmentsX *OSMSegments,WaysX *OSMWays,R
 
  nnodes=0,nways=0,nrelations=0;
 
- printf("\rReading: Lines=0 Nodes=0 Ways=0 Relations=0");
- fflush(stdout);
+ printf_first("Reading: Lines=0 Nodes=0 Ways=0 Relations=0");
 
  retval=ParseXML(file,xml_toplevel_tags,XMLPARSE_UNKNOWN_ATTR_IGNORE);
 
- printf("\rRead: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld   \n",ParseXML_LineNumber(),nnodes,nways,nrelations);
- fflush(stdout);
+ printf_last("Read: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
  return(retval);
 }
index d660154..cba9d4d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/planetsplitter.c,v 1.81 2010/09/17 18:38:39 amb Exp $
+ $Header: /home/amb/routino/src/RCS/planetsplitter.c,v 1.82 2010/11/13 14:22:28 amb Exp $
 
  OSM planet file splitter.
 
@@ -38,6 +38,7 @@
 #include "superx.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 #include "functionsx.h"
 #include "tagging.h"
@@ -92,6 +93,8 @@ int main(int argc,char** argv)
        option_parse_only=1;
     else if(!strcmp(argv[arg],"--process-only"))
        option_process_only=1;
+    else if(!strcmp(argv[arg],"--loggable"))
+       option_loggable=1;
     else if(!strncmp(argv[arg],"--max-iterations=",17))
        max_iterations=atoi(&argv[arg][17]);
     else if(!strncmp(argv[arg],"--tagging=",10))
@@ -396,6 +399,7 @@ static void print_usage(int detail,const char *argerr,const char *err)
          "                      [--sort-ram-size=<size>]\n"
          "                      [--tmpdir=<dirname>]\n"
          "                      [--parse-only | --process-only]\n"
+         "                      [--loggable]\n"
          "                      [--max-iterations=<number>]\n"
          "                      [--tagging=<filename>]\n"
          "                      [<filename.osm> ...]\n");
@@ -430,6 +434,8 @@ static void print_usage(int detail,const char *argerr,const char *err)
             "--parse-only              Parse the input OSM files and store the results.\n"
             "--process-only            Process the stored results from previous option.\n"
             "\n"
+            "--loggable                Print progress messages suitable for logging to file.\n"
+            "\n"
             "--max-iterations=<number> The number of iterations for finding super-nodes.\n"
             "\n"
             "--tagging=<filename>      The name of the XML file containing the tagging rules\n"
index 7b69049..1822f9d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/relationsx.c,v 1.8 2010/10/09 18:20:18 amb Exp $
+ $Header: /home/amb/routino/src/RCS/relationsx.c,v 1.10 2010/11/13 14:57:30 amb Exp $
 
  Extended Relation data type functions.
 
@@ -32,6 +32,7 @@
 #include "relationsx.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 
 
@@ -182,7 +183,6 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
 {
  RouteRelX *unmatched=NULL,*lastunmatched=NULL;
  int nunmatched=0,lastnunmatched=0,iteration=0;
- int i,j;
 
  if(waysx->number==0)
     return;
@@ -206,12 +206,14 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
 
  do
    {
+    int ways=0,relations=0;
+    int i;
+
     SeekFile(relationsx->rfd,0);
 
     /* Print the start message */
 
-    printf("Processing Route Relations: Iteration=%d Relations=0",iteration);
-    fflush(stdout);
+    printf_first("Processing Route Relations: Iteration=%d Relations=0 Modified Ways=0",iteration);
 
     for(i=0;i<relationsx->rxnumber;i++)
       {
@@ -229,18 +231,25 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
        /* Decide what type of route it is */
 
        if(iteration==0)
+         {
+          relations++;
           routes=relationx.routes;
+         }
        else
          {
-          if((lastunmatched[j].routes|relationx.routes)==relationx.routes)
-             routes=0; /* Nothing new to add */
-          else
-             for(j=0;j<lastnunmatched;j++)
-                if(lastunmatched[j].id==relationx.id)
-                  {
+          int j;
+
+          for(j=0;j<lastnunmatched;j++)
+             if(lastunmatched[j].id==relationx.id)
+               {
+                relations++;
+
+                if((lastunmatched[j].routes|relationx.routes)==relationx.routes)
+                   routes=0; /* Nothing new to add */
+                else
                    routes=lastunmatched[j].routes;
-                   break;
-                  }
+                break;
+               }
          }
 
        /* Loop through the ways */
@@ -268,6 +277,8 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
 #if SLIM
                 PutBackWayX(waysx,way,1);
 #endif
+
+                ways++;
                }
             }
          }
@@ -295,10 +306,7 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
        while(relationid);
 
        if(!((i+1)%10000))
-         {
-          printf("\rProcessing Route Relations: Iteration=%d Relations=%d",iteration,i+1);
-          fflush(stdout);
-         }
+          printf_middle("Processing Route Relations: Iteration=%d Relations=%d Modified Ways=%d",iteration,relations,ways);
       }
 
     if(lastunmatched)
@@ -312,8 +320,7 @@ void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx)
 
     /* Print the final message */
 
-    printf("\rProcessed Route Relations: Iteration=%d Relations=%d  \n",iteration,relationsx->rxnumber);
-    fflush(stdout);
+    printf_last("Processed Route Relations: Iteration=%d Relations=%d Modified Ways=%d",iteration,relations,ways);
    }
  while(lastnunmatched && ++iteration<5);
 
index c9eb13b..2b58f3b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/router.c,v 1.89 2010/09/15 18:19:36 amb Exp $
+ $Header: /home/amb/routino/src/RCS/router.c,v 1.90 2010/11/13 14:22:28 amb Exp $
 
  OSM router.
 
@@ -33,6 +33,7 @@
 #include "ways.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 #include "translations.h"
 #include "profiles.h"
@@ -112,6 +113,8 @@ int main(int argc,char** argv)
        exactnodes=1;
     else if(!strcmp(argv[arg],"--quiet"))
        option_quiet=1;
+    else if(!strcmp(argv[arg],"--loggable"))
+       option_loggable=1;
     else if(!strcmp(argv[arg],"--output-html"))
        option_html=1;
     else if(!strcmp(argv[arg],"--output-gpx-track"))
@@ -501,7 +504,7 @@ int main(int argc,char** argv)
 
        if(!option_quiet)
          {
-          printf("\rRouted: Super-Nodes Checked = %d\n",begin->number);
+          printf("Routed: Super-Nodes Checked = %d\n",begin->number);
           fflush(stdout);
          }
       }
@@ -580,7 +583,7 @@ static void print_usage(int detail,const char *argerr,const char *err)
          "              [--dir=<dirname>] [--prefix=<name>]\n"
          "              [--profiles=<filename>] [--translations=<filename>]\n"
          "              [--exact-nodes-only]\n"
-         "              [--quiet]\n"
+         "              [--loggable | --quiet]\n"
          "              [--language=<lang>]\n"
          "              [--output-html]\n"
          "              [--output-gpx-track] [--output-gpx-route]\n"
@@ -631,7 +634,9 @@ static void print_usage(int detail,const char *argerr,const char *err)
             "\n"
             "--exact-nodes-only      Only route between nodes (don't find closest segment).\n"
             "\n"
+            "--loggable              Print progress messages suitable for logging to file.\n"
             "--quiet                 Don't print any screen output when running.\n"
+            "\n"
             "--language=<lang>       Use the translations for specified language.\n"
             "--output-html           Write an HTML description of the route.\n"
             "--output-gpx-track      Write a GPX track file with all route points.\n"
index fe6ed0f..c831531 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/segmentsx.c,v 1.68 2010/10/09 14:14:42 amb Exp $
+ $Header: /home/amb/routino/src/RCS/segmentsx.c,v 1.69 2010/11/13 14:22:28 amb Exp $
 
  Extended Segment data type functions.
 
@@ -41,6 +41,7 @@
 #include "types.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 
 
@@ -184,8 +185,7 @@ void SortSegmentList(SegmentsX* segmentsx)
 
  /* Print the start message */
 
- printf("Sorting Segments");
- fflush(stdout);
+ printf_first("Sorting Segments");
 
  /* Close the files and re-open them (finished appending) */
 
@@ -211,8 +211,7 @@ void SortSegmentList(SegmentsX* segmentsx)
 
  /* Print the final message */
 
- printf("\rSorted Segments: Segments=%d\n",segmentsx->xnumber);
- fflush(stdout);
+ printf_last("Sorted Segments: Segments=%d",segmentsx->xnumber);
 }
 
 
@@ -377,8 +376,7 @@ void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the start message */
 
- printf("Checking: Segments=0 Duplicate=0 Loop=0 Missing-Node=0");
- fflush(stdout);
+ printf_first("Checking: Segments=0 Duplicate=0 Loop=0 Missing-Node=0");
 
  /* Allocate the array of indexes */
 
@@ -416,10 +414,7 @@ void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx)
     total++;
 
     if(!(total%10000))
-      {
-       printf("\rChecking: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
-       fflush(stdout);
-      }
+       printf_middle("Checking: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
    }
 
  /* Close the files and re-open them */
@@ -433,8 +428,7 @@ void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx)
 
  /* Print the final message */
 
- printf("\rChecked: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d  \n",total,duplicate,loop,missing);
- fflush(stdout);
+ printf_last("Checked: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
 }
 
 
@@ -456,8 +450,7 @@ void UpdateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
 
  /* Print the start message */
 
- printf("Measuring Segments: Segments=0");
- fflush(stdout);
+ printf_first("Measuring Segments: Segments=0");
 
  /* Map into memory */
 
@@ -519,10 +512,7 @@ void UpdateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
     index++;
 
     if(!(index%10000))
-      {
-       printf("\rMeasuring Segments: Segments=%d",index);
-       fflush(stdout);
-      }
+       printf_middle("Measuring Segments: Segments=%d",index);
    }
 
  /* Close the files and re-open them */
@@ -548,8 +538,7 @@ void UpdateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
 
  /* Print the final message */
 
- printf("\rMeasured Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Measured Segments: Segments=%d",segmentsx->number);
 }
 
 
@@ -567,8 +556,7 @@ void RotateSegments(SegmentsX* segmentsx)
 
  /* Print the start message */
 
- printf("Rotating Segments: Segments=0 Rotated=0");
- fflush(stdout);
+ printf_first("Rotating Segments: Segments=0 Rotated=0");
 
  /* Close the files and re-open them (finished appending) */
 
@@ -602,10 +590,7 @@ void RotateSegments(SegmentsX* segmentsx)
     index++;
 
     if(!(index%10000))
-      {
-       printf("\rRotating Segments: Segments=%d Rotated=%d",index,rotated);
-       fflush(stdout);
-      }
+       printf_middle("Rotating Segments: Segments=%d Rotated=%d",index,rotated);
    }
 
  /* Close the files and re-open them */
@@ -617,8 +602,7 @@ void RotateSegments(SegmentsX* segmentsx)
 
  /* Print the final message */
 
- printf("\rRotated Segments: Segments=%d Rotated=%d \n",index,rotated);
- fflush(stdout);
+ printf_last("Rotated Segments: Segments=%d Rotated=%d",index,rotated);
 }
 
 
@@ -641,8 +625,7 @@ void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
 
  /* Print the start message */
 
- printf("Deduplicating Segments: Segments=0 Duplicate=0");
- fflush(stdout);
+ printf_first("Deduplicating Segments: Segments=0 Duplicate=0");
 
  /* Map into memory */
 
@@ -720,10 +703,7 @@ void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
     index++;
 
     if(!(index%10000))
-      {
-       printf("\rDeduplicating Segments: Segments=%d Duplicate=%d",index,duplicate);
-       fflush(stdout);
-      }
+       printf_middle("Deduplicating Segments: Segments=%d Duplicate=%d",index,duplicate);
    }
 
  /* Close the files and re-open them */
@@ -749,8 +729,7 @@ void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx)
 
  /* Print the final message */
 
- printf("\rDeduplicated Segments: Segments=%d Duplicate=%d Unique=%d\n",index,duplicate,index-duplicate);
- fflush(stdout);
+ printf_last("Deduplicated Segments: Segments=%d Duplicate=%d Unique=%d",index,duplicate,index-duplicate);
 }
 
 
@@ -771,8 +750,7 @@ void CreateRealSegments(SegmentsX *segmentsx,WaysX *waysx)
 
  /* Print the start message */
 
- printf("Creating Real Segments: Segments=0");
- fflush(stdout);
+ printf_first("Creating Real Segments: Segments=0");
 
  /* Map into memory */
 
@@ -815,10 +793,7 @@ void CreateRealSegments(SegmentsX *segmentsx,WaysX *waysx)
 #endif
 
     if(!((i+1)%10000))
-      {
-       printf("\rCreating Real Segments: Segments=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Creating Real Segments: Segments=%d",i+1);
    }
 
  /* Unmap from memory */
@@ -830,8 +805,7 @@ void CreateRealSegments(SegmentsX *segmentsx,WaysX *waysx)
 
  /* Print the final message */
 
- printf("\rCreating Real Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Creating Real Segments: Segments=%d",segmentsx->number);
 }
 
 
@@ -852,8 +826,7 @@ void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx)
 
  /* Print the start message */
 
- printf("Indexing Nodes: Nodes=0");
- fflush(stdout);
+ printf_first("Indexing Nodes: Nodes=0");
 
  /* Map into memory */
 
@@ -910,10 +883,7 @@ void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx)
     while(1);
 
     if(!((i+1)%10000))
-      {
-       printf("\rIndexing Nodes: Nodes=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Indexing Nodes: Nodes=%d",i+1);
    }
 
  /* Unmap from memory */
@@ -925,8 +895,7 @@ void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx)
 
  /* Print the final message */
 
- printf("\rIndexed Nodes: Nodes=%d \n",nodesx->number);
- fflush(stdout);
+ printf_last("Indexed Nodes: Nodes=%d",nodesx->number);
 }
 
 
@@ -947,8 +916,7 @@ void SaveSegmentList(SegmentsX* segmentsx,const char *filename)
 
  /* Print the start message */
 
- printf("Writing Segments: Segments=0");
- fflush(stdout);
+ printf_first("Writing Segments: Segments=0");
 
  /* Write out the segments data */
 
@@ -968,10 +936,7 @@ void SaveSegmentList(SegmentsX* segmentsx,const char *filename)
     WriteFile(fd,segment,sizeof(Segment));
 
     if(!((i+1)%10000))
-      {
-       printf("\rWriting Segments: Segments=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Writing Segments: Segments=%d",i+1);
    }
 
  /* Write out the header structure */
@@ -987,8 +952,7 @@ void SaveSegmentList(SegmentsX* segmentsx,const char *filename)
 
  /* Print the final message */
 
- printf("\rWrote Segments: Segments=%d  \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Wrote Segments: Segments=%d",segmentsx->number);
 }
 
 
index 20dc065..182daef 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/superx.c,v 1.44 2010/10/09 14:14:42 amb Exp $
+ $Header: /home/amb/routino/src/RCS/superx.c,v 1.45 2010/11/13 14:22:28 amb Exp $
 
  Super-Segment data type functions.
 
@@ -33,6 +33,7 @@
 #include "superx.h"
 
 #include "files.h"
+#include "logging.h"
 #include "results.h"
 
 
@@ -61,8 +62,7 @@ void ChooseSuperNodes(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx)
 
  /* Print the start message */
 
- printf("Finding Super-Nodes: Nodes=0 Super-Nodes=0");
- fflush(stdout);
+ printf_first("Finding Super-Nodes: Nodes=0 Super-Nodes=0");
 
  /* Map into memory */
 
@@ -129,10 +129,7 @@ void ChooseSuperNodes(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx)
       }
 
     if(!((i+1)%10000))
-      {
-       printf("\rFinding Super-Nodes: Nodes=%d Super-Nodes=%d",i+1,nnodes);
-       fflush(stdout);
-      }
+       printf_middle("Finding Super-Nodes: Nodes=%d Super-Nodes=%d",i+1,nnodes);
    }
 
  /* Unmap from memory */
@@ -145,8 +142,7 @@ void ChooseSuperNodes(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx)
 
  /* Print the final message */
 
- printf("\rFound Super-Nodes: Nodes=%d Super-Nodes=%d  \n",nodesx->number,nnodes);
- fflush(stdout);
+ printf_last("Found Super-Nodes: Nodes=%d Super-Nodes=%d",nodesx->number,nnodes);
 }
 
 
@@ -177,8 +173,7 @@ SegmentsX *CreateSuperSegments(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx,
 
  /* Print the start message */
 
- printf("Creating Super-Segments: Super-Nodes=0 Super-Segments=0");
- fflush(stdout);
+ printf_first("Creating Super-Segments: Super-Nodes=0 Super-Segments=0");
 
  /* Map into memory */
 
@@ -257,10 +252,7 @@ SegmentsX *CreateSuperSegments(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx,
        sn++;
 
        if(!(sn%10000))
-         {
-          printf("\rCreating Super-Segments: Super-Nodes=%d Super-Segments=%d",sn,ss);
-          fflush(stdout);
-         }
+          printf_middle("Creating Super-Segments: Super-Nodes=%d Super-Segments=%d",sn,ss);
       }
    }
 
@@ -273,8 +265,7 @@ SegmentsX *CreateSuperSegments(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx,
 
  /* Print the final message */
 
- printf("\rCreated Super-Segments: Super-Nodes=%d Super-Segments=%d \n",sn,ss);
- fflush(stdout);
+ printf_last("Created Super-Segments: Super-Nodes=%d Super-Segments=%d",sn,ss);
 
  return(supersegmentsx);
 }
@@ -303,8 +294,7 @@ SegmentsX *MergeSuperSegments(SegmentsX* segmentsx,SegmentsX* supersegmentsx)
 
  /* Print the start message */
 
- printf("Merging: Segments=0 Super-Segments=0 Merged=0 Added=0");
- fflush(stdout);
+ printf_first("Merging: Segments=0 Super-Segments=0 Merged=0 Added=0");
 
  /* Map into memory */
 
@@ -358,10 +348,7 @@ SegmentsX *MergeSuperSegments(SegmentsX* segmentsx,SegmentsX* supersegmentsx)
        AppendSegment(mergedsegmentsx,segmentx->way,segmentx->node1,segmentx->node2,segmentx->distance|SEGMENT_NORMAL);
 
     if(!((i+1)%10000))
-      {
-       printf("\rMerging: Segments=%d Super-Segments=%d Merged=%d Added=%d",i+1,j,m,a);
-       fflush(stdout);
-      }
+       printf_middle("Merging: Segments=%d Super-Segments=%d Merged=%d Added=%d",i+1,j,m,a);
    }
 
  /* Unmap from memory */
@@ -373,8 +360,7 @@ SegmentsX *MergeSuperSegments(SegmentsX* segmentsx,SegmentsX* supersegmentsx)
 
  /* Print the final message */
 
- printf("\rMerged: Segments=%d Super-Segments=%d Merged=%d Added=%d \n",segmentsx->number,supersegmentsx->number,m,a);
- fflush(stdout);
+ printf_last("Merged: Segments=%d Super-Segments=%d Merged=%d Added=%d",segmentsx->number,supersegmentsx->number,m,a);
 
  return(mergedsegmentsx);
 }
index 80dba87..e01b490 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/tagmodifier.c,v 1.7 2010/09/05 18:26:01 amb Exp $
+ $Header: /home/amb/routino/src/RCS/tagmodifier.c,v 1.8 2010/11/13 14:22:28 amb Exp $
 
  Test application for OSM XML file parser / tagging rule testing.
 
@@ -29,6 +29,7 @@
 #include <errno.h>
 
 #include "files.h"
+#include "logging.h"
 #include "xmlparse.h"
 #include "tagging.h"
 
@@ -258,7 +259,7 @@ static int nodeType_function(const char *_tag_,int _type_,const char *id,const c
     nnodes++;
 
     if(!(nnodes%1000))
-       fprintf(stderr,"\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
+       fprintf_middle(stderr,"Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
    }
@@ -374,7 +375,7 @@ static int wayType_function(const char *_tag_,int _type_,const char *id,const ch
     nways++;
 
     if(!(nways%1000))
-       fprintf(stderr,"\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
+       fprintf_middle(stderr,"Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
    }
@@ -440,7 +441,7 @@ static int relationType_function(const char *_tag_,int _type_,const char *id,con
     nrelations++;
 
     if(!(nrelations%1000))
-       fprintf(stderr,"\rReading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
+       fprintf_middle(stderr,"Reading: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
     current_tags=NewTagList();
    }
@@ -539,6 +540,8 @@ int main(int argc,char **argv)
    {
     if(!strcmp(argv[arg],"--help"))
        print_usage(1);
+    else if(!strcmp(argv[arg],"--loggable"))
+       option_loggable=1;
     else if(!strncmp(argv[arg],"--tagging=",10))
        tagging=&argv[arg][10];
     else if(argv[arg][0]=='-' && argv[arg][1]=='-')
@@ -593,11 +596,11 @@ int main(int argc,char **argv)
 
  /* Parse the file */
 
- fprintf(stderr,"\rReading: Lines=0 Nodes=0 Ways=0 Relations=0");
+ fprintf_first(stderr,"Reading: Lines=0 Nodes=0 Ways=0 Relations=0");
 
  retval=ParseXML(file,xml_toplevel_tags,XMLPARSE_UNKNOWN_ATTR_IGNORE);
 
- fprintf(stderr,"\rRead: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld   \n",ParseXML_LineNumber(),nnodes,nways,nrelations);
+ fprintf_last(stderr,"Read: Lines=%ld Nodes=%ld Ways=%ld Relations=%ld",ParseXML_LineNumber(),nnodes,nways,nrelations);
 
  /* Tidy up */
 
@@ -618,6 +621,7 @@ static void print_usage(int detail)
 {
  fprintf(stderr,
          "Usage: tagmodifier [--help]\n"
+         "                   [--loggable]\n"
          "                   [--tagging=<filename>]\n"
          "                   [<filename.osm>]\n");
 
@@ -626,6 +630,8 @@ static void print_usage(int detail)
             "\n"
             "--help                    Prints this information.\n"
             "\n"
+            "--loggable                Print progress messages suitable for logging to file.\n"
+            "\n"
             "--tagging=<filename>      The name of the XML file containing the tagging rules\n"
             "                          (defaults to 'tagging.xml' in current directory).\n"
             "\n"
index 1a45bb1..619fad6 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/waysx.c,v 1.51 2010/09/19 16:17:45 amb Exp $
+ $Header: /home/amb/routino/src/RCS/waysx.c,v 1.52 2010/11/13 14:22:28 amb Exp $
 
  Extended Way data type functions.
 
@@ -33,6 +33,7 @@
 #include "waysx.h"
 
 #include "files.h"
+#include "logging.h"
 #include "functions.h"
 
 
@@ -183,8 +184,7 @@ void SortWayList(WaysX* waysx)
 
  /* Print the start message */
 
- printf("Sorting Ways by Name");
- fflush(stdout);
+ printf_first("Sorting Ways by Name");
 
  /* Close the file and re-open it (finished appending) */
 
@@ -206,14 +206,12 @@ void SortWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rSorted Ways by Name: Ways=%d\n",waysx->xnumber);
- fflush(stdout);
+ printf_last("Sorted Ways by Name: Ways=%d",waysx->xnumber);
 
 
  /* Print the start message */
 
- printf("Separating Way Names: Ways=0 Names=0");
- fflush(stdout);
+ printf_first("Separating Way Names: Ways=0 Names=0");
 
  /* Open the files */
 
@@ -254,10 +252,7 @@ void SortWayList(WaysX* waysx)
     WriteFile(fd,&wayx,sizeof(WayX));
 
     if(!((i+1)%10000))
-      {
-       printf("\rSeparating Way Names: Ways=%d Names=%d",i+1,nnames);
-       fflush(stdout);
-      }
+       printf_middle("Separating Way Names: Ways=%d Names=%d",i+1,nnames);
    }
 
  if(names[0]) free(names[0]);
@@ -274,14 +269,12 @@ void SortWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rSeparated Way Names: Ways=%d Names=%d \n",waysx->xnumber,nnames);
- fflush(stdout);
+ printf_last("Separated Way Names: Ways=%d Names=%d ",waysx->xnumber,nnames);
 
 
  /* Print the start message */
 
- printf("Sorting Ways");
- fflush(stdout);
+ printf_first("Sorting Ways");
 
  /* Open the files */
 
@@ -314,8 +307,7 @@ void SortWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rSorted Ways: Ways=%d Duplicates=%d\n",waysx->number,waysx->xnumber-waysx->number);
- fflush(stdout);
+ printf_last("Sorted Ways: Ways=%d Duplicates=%d",waysx->number,waysx->xnumber-waysx->number);
 }
 
 
@@ -333,8 +325,7 @@ void CompactWayList(WaysX* waysx)
 
  /* Print the start message */
 
- printf("Sorting Ways by Properties");
- fflush(stdout);
+ printf_first("Sorting Ways by Properties");
 
  /* Close the file and re-open it */
 
@@ -356,14 +347,12 @@ void CompactWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rSorted Ways by Properties: Ways=%d\n",waysx->number);
- fflush(stdout);
+ printf_last("Sorted Ways by Properties: Ways=%d",waysx->number);
 
 
  /* Print the start message */
 
- printf("Compacting Ways: Ways=0 Properties=0");
- fflush(stdout);
+ printf_first("Compacting Ways: Ways=0 Properties=0");
 
  /* Open the files */
 
@@ -395,10 +384,7 @@ void CompactWayList(WaysX* waysx)
     WriteFile(fd,&wayx,sizeof(WayX));
 
     if(!((i+1)%10000))
-      {
-       printf("\rCompacting Ways: Ways=%d Properties=%d",i+1,waysx->cnumber);
-       fflush(stdout);
-      }
+       printf_middle("Compacting Ways: Ways=%d Properties=%d",i+1,waysx->cnumber);
    }
 
  /* Close the files */
@@ -408,14 +394,12 @@ void CompactWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rCompacted Ways: Ways=%d Properties=%d \n",waysx->number,waysx->cnumber);
- fflush(stdout);
+ printf_last("Compacted Ways: Ways=%d Properties=%d ",waysx->number,waysx->cnumber);
 
 
  /* Print the start message */
 
- printf("Sorting Ways");
- fflush(stdout);
+ printf_first("Sorting Ways");
 
  /* Open the files */
 
@@ -438,8 +422,7 @@ void CompactWayList(WaysX* waysx)
 
  /* Print the final message */
 
- printf("\rSorted Ways: Ways=%d\n",waysx->number);
- fflush(stdout);
+ printf_last("Sorted Ways: Ways=%d",waysx->number);
 }
 
 
@@ -629,8 +612,7 @@ void SaveWayList(WaysX* waysx,const char *filename)
 
  /* Print the start message */
 
- printf("Writing Ways: Ways=0");
- fflush(stdout);
+ printf_first("Writing Ways: Ways=0");
 
  /* Map into memory */
 
@@ -655,10 +637,7 @@ void SaveWayList(WaysX* waysx,const char *filename)
     WriteFile(fd,&wayx->way,sizeof(Way));
 
     if(!((i+1)%10000))
-      {
-       printf("\rWriting Ways: Ways=%d",i+1);
-       fflush(stdout);
-      }
+       printf_middle("Writing Ways: Ways=%d",i+1);
    }
 
  /* Unmap from memory */
@@ -704,6 +683,5 @@ void SaveWayList(WaysX* waysx,const char *filename)
 
  /* Print the final message */
 
- printf("\rWrote Ways: Ways=%d  \n",waysx->number);
- fflush(stdout);
+ printf_last("Wrote Ways: Ways=%d",waysx->number);
 }
index a45b1d5..e68ba1a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!-- ============================================================
-     $Header: /home/amb/routino/xml/RCS/routino-translations.xml,v 1.10 2010/09/15 18:30:37 amb Exp $
+     $Header: /home/amb/routino/xml/RCS/routino-translations.xml,v 1.11 2010/11/13 14:59:55 amb Exp $
 
      An XML format file containing Routino output translations.
 
     <highway type="cycleway"     string="Fietspad" />
     <highway type="path"         string="Pad" />
     <highway type="steps"        string="Trap" />
-    <highway type="ferry"        string="ferry" /> <!-- FIXME - needs translation -->
+    <highway type="ferry"        string="Fähre" />
 
     <!-- The type of route -->
     <route type="shortest" string="Kortste" /> <!-- For the description and route name -->