You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Pascal F M. <pas...@us...> - 2006-01-15 03:08:19
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4869 Modified Files: rdmxchange_street.c Log Message: Cleanup Index: rdmxchange_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_street.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_street.c 11 Jan 2006 09:55:58 -0000 1.1 --- rdmxchange_street.c 15 Jan 2006 03:08:10 -0000 1.2 *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * SYNOPSYS: - * - * see roadmap_street.h. */ --- 20,23 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-15 03:07:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4800 Modified Files: rdmxchange_main.c Log Message: Complete export code for rdmxchange Index: rdmxchange_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rdmxchange_main.c 11 Jan 2006 09:55:40 -0000 1.2 --- rdmxchange_main.c 15 Jan 2006 03:07:47 -0000 1.3 *************** *** 53,56 **** --- 53,64 ---- void rdmxchange_main_register_export (RdmXchangeExport *export) { + int i; + + for (i = 0; i < RdmXchangeExportRegistered; ++i) { + if (RdmXchangeExportList[i] == export) { + return; /* Already registered. */ + } + } + if (RdmXchangeExportRegistered >= RDMXCHANGE_MAX_MODULES) { fprintf (stderr, "too many tables\n"); *************** *** 73,80 **** RdmMapModel = roadmap_db_register (RdmMapModel, "street", &RoadMapStreetExport); - /* TBD RdmMapModel = roadmap_db_register (RdmMapModel, "range", &RoadMapRangeExport); - */ RdmMapModel = roadmap_db_register (RdmMapModel, "polygon", &RoadMapPolygonExport); --- 81,86 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-15 03:07:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4749 Modified Files: rdmxchange.h Log Message: Complete export code for rdmxchange Index: rdmxchange.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rdmxchange.h 11 Jan 2006 09:56:24 -0000 1.2 --- rdmxchange.h 15 Jan 2006 03:07:24 -0000 1.3 *************** *** 55,58 **** --- 55,59 ---- extern roadmap_db_handler RoadMapStreetExport; extern roadmap_db_handler RoadMapZipExport; + extern roadmap_db_handler RoadMapRangeExport; #endif // INCLUDED__RDMXCHANGE__H |
From: Pascal F M. <pas...@us...> - 2006-01-15 03:07:15
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4720 Modified Files: Makefile Log Message: Complete export code for rdmxchange Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Makefile 11 Jan 2006 09:58:58 -0000 1.72 --- Makefile 15 Jan 2006 03:07:05 -0000 1.73 *************** *** 243,246 **** --- 243,247 ---- rdmxchange_square.c \ rdmxchange_street.c \ + rdmxchange_range.c \ rdmxchange_zip.c |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:59:12
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2477 Modified Files: Makefile Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** Makefile 2 Jan 2006 09:15:53 -0000 1.71 --- Makefile 11 Jan 2006 09:58:58 -0000 1.72 *************** *** 233,236 **** --- 233,251 ---- + XCHGSRCS=rdmxchange_main.c \ + rdmxchange_dictionary.c \ + rdmxchange_index.c \ + rdmxchange_metadata.c \ + rdmxchange_point.c \ + rdmxchange_line.c \ + rdmxchange_shape.c \ + rdmxchange_polygon.c \ + rdmxchange_square.c \ + rdmxchange_street.c \ + rdmxchange_zip.c + + XCHGOBJS=$(XCHGSRCS:.c=.o) + + PKGDATAFILES=sprites preferences schema session drivers roadmap.popup BUILD=buildmap buildus dumpmap buildplace *************** *** 265,268 **** --- 280,285 ---- fi + unix/libosroadmap.a: unix + gpx: if [ -d gpx ] ; then \ *************** *** 270,273 **** --- 287,292 ---- fi + gpx/libgpx.a: gpx + runtime: unix gpx $(RUNTIME) $(DRIVERS) for module in $(RDMODULES) ; \ *************** *** 404,407 **** --- 423,429 ---- $(CC) -g rdmindex_main.c -o rdmindex libbuildmap.a $(RDMLIBS) $(LIBS) + rdmxchange : $(XCHGOBJS) $(RDMLIBS) + $(CC) -g -o rdmxchange $(XCHGOBJS) $(RDMLIBS) $(LIBS) + rdmkismet: roadmap_kismet.c $(RDMLIBS) $(CC) -g roadmap_kismet.c -o rdmkismet $(RDMLIBS) $(RDMLIBS) -lm |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:58:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2311 Modified Files: roadmap_db_street.h Log Message: Cleanup & updates Index: roadmap_db_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_street.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_db_street.h 21 Feb 2003 20:07:33 -0000 1.1.1.1 --- roadmap_db_street.h 11 Jan 2006 09:58:18 -0000 1.2 *************** *** 25,29 **** * The RoadMap streets are described by the following table: * ! * street the identification (type, name, etc..) of each street. */ --- 25,30 ---- * The RoadMap streets are described by the following table: * ! * street/name the identification (prefix, name, etc..) of each street. ! * street/type the type of each street. */ *************** *** 33,37 **** #include "roadmap_types.h" ! typedef struct { RoadMapString fedirp; --- 34,38 ---- #include "roadmap_types.h" ! typedef struct { /* Table street/name. */ RoadMapString fedirp; *************** *** 42,45 **** --- 43,48 ---- } RoadMapStreet; + /* Table street/type is an array of char. */ + #endif // _ROADMAP_DB_STREET__H_ |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:57:46
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2090 Modified Files: rdmxchange_square.c Log Message: Small improvements to the .rdx format Index: rdmxchange_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_square.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_square.c 9 Jan 2006 07:44:34 -0000 1.1 --- rdmxchange_square.c 11 Jan 2006 09:57:39 -0000 1.2 *************** *** 113,133 **** static void rdmxchange_square_export_head (FILE *file) { ! fprintf (file, "table square/global 1" ! " edges.east" ! " edges.north" ! " edges.west" ! " edges.south" ! " step.longitude" ! " step.latitude" ! " squares.count\n"); ! fprintf (file, "table square/data %d" ! " edges.east" ! " edges.north" ! " edges.west" ! " edges.south" ! " points.count" ! " position\n", ! RoadMapSquareActive->SquareCount); } --- 113,120 ---- static void rdmxchange_square_export_head (FILE *file) { ! fprintf (file, "table square/global 1\n"); ! fprintf (file, "table square/data %d\n", ! RoadMapSquareActive->SquareCount); } *************** *** 138,144 **** RoadMapSquare *square; ! fprintf (file, "table square/global\n"); ! fprintf (file, "%d,%d,%d,%d,", RoadMapSquareActive->SquareGlobal->edges.east, RoadMapSquareActive->SquareGlobal->edges.north, --- 125,138 ---- RoadMapSquare *square; ! fprintf (file, "table square/global\n" ! "edges.east," ! "edges.north," ! "edges.west," ! "edges.south," ! "step.longitude," ! "step.latitude," ! "squares.count\n"); ! fprintf (file, "%.0d,%.0d,%.0d,%.0d,", RoadMapSquareActive->SquareGlobal->edges.east, RoadMapSquareActive->SquareGlobal->edges.north, *************** *** 146,150 **** RoadMapSquareActive->SquareGlobal->edges.south); ! fprintf (file, "%d,%d,%d,%d,%d\n\n", RoadMapSquareActive->SquareGlobal->step_longitude, RoadMapSquareActive->SquareGlobal->step_latitude, --- 140,144 ---- RoadMapSquareActive->SquareGlobal->edges.south); ! fprintf (file, "%.0d,%.0d,%.0d,%.0d,%.0d\n\n", RoadMapSquareActive->SquareGlobal->step_longitude, RoadMapSquareActive->SquareGlobal->step_latitude, *************** *** 154,168 **** ! fprintf (file, "table square/data\n"); square = RoadMapSquareActive->Square; for (i = 0; i < RoadMapSquareActive->SquareCount; ++i, ++square) { ! fprintf (file, "%d,%d,%d,%d,", square->edges.east, ! square->edges.north, ! square->edges.west, ! square->edges.south); ! fprintf (file, "%d,%d\n", square->count_points, square->position); } fprintf (file, "\n"); --- 148,168 ---- ! fprintf (file, "table square/data\n" ! "edges.east," ! "edges.north," ! "edges.west," ! "edges.south," ! "points.count," ! "position\n"); square = RoadMapSquareActive->Square; for (i = 0; i < RoadMapSquareActive->SquareCount; ++i, ++square) { ! fprintf (file, "%.0d,%.0d,%.0d,%.0d,", square->edges.east, ! square->edges.north, ! square->edges.west, ! square->edges.south); ! fprintf (file, "%.0d,%.0d\n", square->count_points, square->position); } fprintf (file, "\n"); |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:57:31
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2004 Modified Files: rdmxchange_shape.c Log Message: Small improvements to the .rdx format Index: rdmxchange_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_shape.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_shape.c 9 Jan 2006 07:44:25 -0000 1.1 --- rdmxchange_shape.c 11 Jan 2006 09:57:17 -0000 1.2 *************** *** 153,163 **** static void rdmxchange_shape_export_head (FILE *file) { ! fprintf (file, "table shape/bysquare %d first count\n", RoadMapShapeActive->ShapeBySquareCount); ! fprintf (file, "table shape/byline %d line first count\n", RoadMapShapeActive->ShapeByLineCount); ! fprintf (file, "table shape/data %d longitude latitude\n", RoadMapShapeActive->ShapeCount); } --- 153,163 ---- static void rdmxchange_shape_export_head (FILE *file) { ! fprintf (file, "table shape/bysquare %d\n", RoadMapShapeActive->ShapeBySquareCount); ! fprintf (file, "table shape/byline %d\n", RoadMapShapeActive->ShapeByLineCount); ! fprintf (file, "table shape/data %d\n", RoadMapShapeActive->ShapeCount); } *************** *** 172,198 **** ! fprintf (file, "table shape/bysquare\n"); bysquare = RoadMapShapeActive->ShapeBySquare; for (i = 0; i < RoadMapShapeActive->ShapeBySquareCount; ++i, ++bysquare) { ! fprintf (file, "%d,%d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); ! fprintf (file, "table shape/byline\n"); byline = RoadMapShapeActive->ShapeByLine; for (i = 0; i < RoadMapShapeActive->ShapeByLineCount; ++i, ++byline) { ! fprintf (file, "%d,%d,%d\n", byline->line, byline->first, byline->count); } fprintf (file, "\n"); ! fprintf (file, "table shape/data\n"); point = RoadMapShapeActive->Shape; for (i = 0; i < RoadMapShapeActive->ShapeCount; ++i, ++point) { ! fprintf (file, "%d,%d\n", point->delta_longitude, point->delta_latitude); } fprintf (file, "\n"); --- 172,204 ---- ! fprintf (file, "table shape/bysquare\n" ! "first,count\n"); bysquare = RoadMapShapeActive->ShapeBySquare; for (i = 0; i < RoadMapShapeActive->ShapeBySquareCount; ++i, ++bysquare) { ! fprintf (file, "%.0d,%.0d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); ! fprintf (file, "table shape/byline\n" ! "line,first,count\n"); byline = RoadMapShapeActive->ShapeByLine; for (i = 0; i < RoadMapShapeActive->ShapeByLineCount; ++i, ++byline) { ! fprintf (file, "%.0d,%.0d,%.0d\n", byline->line, ! byline->first, ! byline->count); } fprintf (file, "\n"); ! fprintf (file, "table shape/data\n" ! "longitude,latitude\n"); point = RoadMapShapeActive->Shape; for (i = 0; i < RoadMapShapeActive->ShapeCount; ++i, ++point) { ! fprintf (file, "%.0d,%.0d\n", point->delta_longitude, ! point->delta_latitude); } fprintf (file, "\n"); |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:57:02
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1868 Modified Files: rdmxchange_polygon.c Log Message: Small improvements to the .rdx format Index: rdmxchange_polygon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_polygon.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_polygon.c 9 Jan 2006 07:44:18 -0000 1.1 --- rdmxchange_polygon.c 11 Jan 2006 09:56:54 -0000 1.2 *************** *** 127,142 **** static void rdmxchange_polygon_export_head (FILE *file) { ! fprintf (file, "table polygon/head %d" ! " points.first" ! " points.count" ! " name" ! " layer" ! " edges.east" ! " edges.north" ! " edges.west" ! " edges.south\n", RoadMapPolygonActive->PolygonCount); ! fprintf (file, "table polygon/points %d index\n", RoadMapPolygonActive->PolygonPointCount); } --- 127,134 ---- static void rdmxchange_polygon_export_head (FILE *file) { ! fprintf (file, "table polygon/head %d\n", RoadMapPolygonActive->PolygonCount); ! fprintf (file, "table polygon/points %d\n", RoadMapPolygonActive->PolygonPointCount); } *************** *** 150,168 **** ! fprintf (file, "table polygon/head\n"); polygon = RoadMapPolygonActive->Polygon; for (i = 0; i < RoadMapPolygonActive->PolygonCount; ++i, ++polygon) { ! fprintf (file, "%d,%d,", polygon->first, polygon->count); ! fprintf (file, "%d,%d,", polygon->name, polygon->cfcc); ! fprintf (file, "%d,%d,%d,%d\n", polygon->east, ! polygon->north, ! polygon->west, ! polygon->south); } fprintf (file, "\n"); ! fprintf (file, "table polygon/point\n"); point = RoadMapPolygonActive->PolygonPoint; --- 142,169 ---- ! fprintf (file, "table polygon/head\n" ! "points.first," ! "points.count," ! "name," ! "layer," ! "edges.east," ! "edges.north," ! "edges.west," ! "edges.south\n"); polygon = RoadMapPolygonActive->Polygon; for (i = 0; i < RoadMapPolygonActive->PolygonCount; ++i, ++polygon) { ! fprintf (file, "%.0d,%.0d,", polygon->first, polygon->count); ! fprintf (file, "%.0d,%.0d,", polygon->name, polygon->cfcc); ! fprintf (file, "%.0d,%.0d,%.0d,%.0d\n", polygon->east, ! polygon->north, ! polygon->west, ! polygon->south); } fprintf (file, "\n"); ! fprintf (file, "table polygon/point\n" ! "index\n"); point = RoadMapPolygonActive->PolygonPoint; |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:56:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1752 Modified Files: rdmxchange.h Log Message: Add support for the zip & street tables Index: rdmxchange.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange.h 9 Jan 2006 07:43:31 -0000 1.1 --- rdmxchange.h 11 Jan 2006 09:56:24 -0000 1.2 *************** *** 53,56 **** --- 53,58 ---- extern roadmap_db_handler RoadMapShapeExport; extern roadmap_db_handler RoadMapSquareExport; + extern roadmap_db_handler RoadMapStreetExport; + extern roadmap_db_handler RoadMapZipExport; #endif // INCLUDED__RDMXCHANGE__H |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:56:13
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1649 Added Files: rdmxchange_zip.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_zip.c --- /* rdmxchange_zip.c - Export Postal code data. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" static char *RoadMapZipType = "RoadMapZipContext"; typedef struct { char *type; int *ZipCode; int ZipCodeCount; } RoadMapZipContext; static RoadMapZipContext *RoadMapZipActive = NULL; static void rdmxchange_zip_register_export (void); static void *rdmxchange_zip_map (roadmap_db *root) { RoadMapZipContext *context; context = malloc (sizeof(RoadMapZipContext)); roadmap_check_allocated(context); context->type = RoadMapZipType; context->ZipCode = (int *) roadmap_db_get_data (root); context->ZipCodeCount = roadmap_db_get_count(root); if (roadmap_db_get_size (root) != context->ZipCodeCount * sizeof(int)) { roadmap_log (ROADMAP_FATAL, "invalid zip structure"); } rdmxchange_zip_register_export (); return context; } static void rdmxchange_zip_activate (void *context) { RoadMapZipContext *this = (RoadMapZipContext *) context; if ((this != NULL) && (this->type != RoadMapZipType)) { roadmap_log (ROADMAP_FATAL, "cannot activate (bad context type)"); } RoadMapZipActive = this; } static void rdmxchange_zip_unmap (void *context) { RoadMapZipContext *this = (RoadMapZipContext *) context; if (this->type != RoadMapZipType) { roadmap_log (ROADMAP_FATAL, "cannot unmap (bad context type)"); } if (RoadMapZipActive == this) { RoadMapZipActive = NULL; } free (this); } roadmap_db_handler RoadMapZipExport = { "zip", rdmxchange_zip_map, rdmxchange_zip_activate, rdmxchange_zip_unmap }; static void rdmxchange_zip_export_head (FILE *file) { fprintf (file, "table zip %d\n", RoadMapZipActive->ZipCodeCount); } static void rdmxchange_zip_export_data (FILE *file) { int i; int *zipcode; fprintf (file, "table zip\n" "code\n"); zipcode = RoadMapZipActive->ZipCode; for (i = 0; i < RoadMapZipActive->ZipCodeCount; ++i, ++zipcode) { fprintf (file, "%d\n", *zipcode); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeZipExport = { "zip", rdmxchange_zip_export_head, rdmxchange_zip_export_data }; static void rdmxchange_zip_register_export (void) { rdmxchange_main_register_export (&RdmXchangeZipExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:56:06
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1627 Added Files: rdmxchange_street.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_street.c --- /* rdmxchange_street.c - Export streets attributes. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SYNOPSYS: * * see roadmap_street.h. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "roadmap_db_street.h" #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" static char *RoadMapStreetType = "RoadMapStreetContext"; typedef struct { char *type; RoadMapStreet *Streets; char *StreetType; int StreetsCount; } RoadMapStreetContext; static RoadMapStreetContext *RoadMapStreetActive = NULL; static void rdmxchange_street_register_export (void); static void *rdnxchange_street_map (roadmap_db *root) { RoadMapStreetContext *context; roadmap_db *table; context = malloc (sizeof(RoadMapStreetContext)); roadmap_check_allocated(context); context->type = RoadMapStreetType; table = roadmap_db_get_subsection (root, "name"); context->Streets = (RoadMapStreet *) roadmap_db_get_data (table); context->StreetsCount = roadmap_db_get_count(table); if (roadmap_db_get_size (table) != context->StreetsCount * sizeof(RoadMapStreet)) { roadmap_log (ROADMAP_FATAL, "invalid street structure (%d != %d / %d)", context->StreetsCount, roadmap_db_get_size (table), sizeof(RoadMapStreet)); } table = roadmap_db_get_subsection (root, "type"); context->StreetType = (char *) roadmap_db_get_data (table); if (roadmap_db_get_count(table) != context->StreetsCount) { roadmap_log (ROADMAP_FATAL, "inconsistent count of street"); } rdmxchange_street_register_export(); return context; } static void rdnxchange_street_activate (void *context) { RoadMapStreetContext *this = (RoadMapStreetContext *) context; if ((this != NULL) && (this->type != RoadMapStreetType)) { roadmap_log (ROADMAP_FATAL, "cannot activate (bad context type)"); } RoadMapStreetActive = this; } static void rdnxchange_street_unmap (void *context) { RoadMapStreetContext *this = (RoadMapStreetContext *) context; if (this->type != RoadMapStreetType) { roadmap_log (ROADMAP_FATAL, "cannot unmap (bad context type)"); } if (RoadMapStreetActive == this) { RoadMapStreetActive = NULL; } free (this); } roadmap_db_handler RoadMapStreetExport = { "street", rdnxchange_street_map, rdnxchange_street_activate, rdnxchange_street_unmap }; static void rdmxchange_street_export_head (FILE *file) { fprintf (file, "table street/name %d\n", RoadMapStreetActive->StreetsCount); fprintf (file, "table street/type %d\n", RoadMapStreetActive->StreetsCount); } static void rdmxchange_street_export_data (FILE *file) { int i; char *streetstype; RoadMapStreet *street; fprintf (file, "table street/name\n" "fedirp," "fename," "fetype," "fedirs\n"); street = RoadMapStreetActive->Streets; for (i = 0; i < RoadMapStreetActive->StreetsCount; ++i, ++street) { fprintf (file, "%.0d,%.0d,%.0d,%.0d\n", street->fedirp, street->fename, street->fetype, street->fedirs); } fprintf (file, "\n"); fprintf (file, "table street/type\n" "type\n"); streetstype = RoadMapStreetActive->StreetType; for (i = 0; i < RoadMapStreetActive->StreetsCount; ++i, ++streetstype) { fprintf (file, "%d\n", *streetstype); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeStreetExport = { "street", rdmxchange_street_export_head, rdmxchange_street_export_data }; static void rdmxchange_street_register_export (void) { rdmxchange_main_register_export (&RdmXchangeStreetExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:55:52
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1561 Modified Files: rdmxchange_main.c Log Message: Add support for the zip & street tables Index: rdmxchange_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_main.c 9 Jan 2006 07:43:54 -0000 1.1 --- rdmxchange_main.c 11 Jan 2006 09:55:40 -0000 1.2 *************** *** 69,77 **** - /* TBD RdmMapModel = roadmap_db_register (RdmMapModel, "zip", &RoadMapZipExport); RdmMapModel = roadmap_db_register (RdmMapModel, "street", &RoadMapStreetExport); RdmMapModel = roadmap_db_register (RdmMapModel, "range", &RoadMapRangeExport); --- 69,77 ---- RdmMapModel = roadmap_db_register (RdmMapModel, "zip", &RoadMapZipExport); RdmMapModel = roadmap_db_register (RdmMapModel, "street", &RoadMapStreetExport); + /* TBD RdmMapModel = roadmap_db_register (RdmMapModel, "range", &RoadMapRangeExport); |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:55:03
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1356 Modified Files: rdmxchange_point.c Log Message: Small improvements to the .rdx format Index: rdmxchange_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_point.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_point.c 9 Jan 2006 07:44:10 -0000 1.1 --- rdmxchange_point.c 11 Jan 2006 09:54:54 -0000 1.2 *************** *** 121,128 **** static void rdmxchange_point_export_head (FILE *file) { ! fprintf (file, "table point/data %d longitude latitude\n", RoadMapPointActive->PointCount); ! fprintf (file, "table point/bysquare %d first count\n", RoadMapPointActive->BySquareCount); } --- 121,128 ---- static void rdmxchange_point_export_head (FILE *file) { ! fprintf (file, "table point/data %d\n", RoadMapPointActive->PointCount); ! fprintf (file, "table point/bysquare %d\n", RoadMapPointActive->BySquareCount); } *************** *** 136,153 **** ! fprintf (file, "table point/data\n"); point = RoadMapPointActive->Point; for (i = 0; i < RoadMapPointActive->PointCount; ++i, ++point) { ! fprintf (file, "%d,%d\n", point->longitude, point->latitude); } fprintf (file, "\n"); ! fprintf (file, "table point/bysquare\n"); bysquare = RoadMapPointActive->BySquare; for (i = 0; i < RoadMapPointActive->BySquareCount; ++i, ++bysquare) { ! fprintf (file, "%d,%d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); --- 136,155 ---- ! fprintf (file, "table point/data\n" ! "longitude,latitude\n"); point = RoadMapPointActive->Point; for (i = 0; i < RoadMapPointActive->PointCount; ++i, ++point) { ! fprintf (file, "%.0d,%.0d\n", point->longitude, point->latitude); } fprintf (file, "\n"); ! fprintf (file, "table point/bysquare\n" ! "first,count\n"); bysquare = RoadMapPointActive->BySquare; for (i = 0; i < RoadMapPointActive->BySquareCount; ++i, ++bysquare) { ! fprintf (file, "%.0d,%.0d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:54:33
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1240 Modified Files: rdmxchange_metadata.c Log Message: Small improvements to the .rdx format Index: rdmxchange_metadata.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_metadata.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_metadata.c 9 Jan 2006 07:44:02 -0000 1.1 --- rdmxchange_metadata.c 11 Jan 2006 09:54:26 -0000 1.2 *************** *** 140,152 **** if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ ! fprintf (file, "table metadata/attributes %d" ! " category" ! " name" ! " value.first" ! " value.count\n", ! RoadMapMetadataActive->AttributesCount); ! fprintf (file, "table metadata/values %d index\n", ! RoadMapMetadataActive->ValuesCount); } --- 140,148 ---- if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ ! fprintf (file, "table metadata/attributes %d\n", ! RoadMapMetadataActive->AttributesCount); ! fprintf (file, "table metadata/values %d\n", ! RoadMapMetadataActive->ValuesCount); } *************** *** 161,177 **** if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ ! fprintf (file, "table metadata/attributes\n"); attributes = RoadMapMetadataActive->Attributes; for (i = 0; i < RoadMapMetadataActive->AttributesCount; ++i) { ! fprintf (file, "%d,%d,%d,%d\n", attributes[i].category, ! attributes[i].name, ! attributes[i].value_first, ! attributes[i].value_count); } fprintf (file, "\n"); ! fprintf (file, "table metadata/values\n"); values = RoadMapMetadataActive->Values; --- 157,178 ---- if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ ! fprintf (file, "table metadata/attributes\n" ! "category," ! "name," ! "value.first," ! "value.count\n"); attributes = RoadMapMetadataActive->Attributes; for (i = 0; i < RoadMapMetadataActive->AttributesCount; ++i) { ! fprintf (file, "%.0d,%.0d,%.0d,%.0d\n", attributes[i].category, ! attributes[i].name, ! attributes[i].value_first, ! attributes[i].value_count); } fprintf (file, "\n"); ! fprintf (file, "table metadata/values\n" ! "index\n"); values = RoadMapMetadataActive->Values; |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:54:08
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1132 Modified Files: rdmxchange_line.c Log Message: Small improvements to the .rdx format Index: rdmxchange_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_line.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_line.c 9 Jan 2006 07:43:47 -0000 1.1 --- rdmxchange_line.c 11 Jan 2006 09:53:59 -0000 1.2 *************** *** 161,177 **** static void rdmxchange_line_export_head (FILE *file) { ! fprintf (file, "table line/data %d from to\n", RoadMapLineActive->LineCount); ! fprintf (file, "table line/bysquare1 %d first[%d] last\n", ! RoadMapLineActive->LineBySquare1Count, ! ROADMAP_CATEGORY_RANGE); ! fprintf (file, "table line/index2 %d index\n", RoadMapLineActive->LineIndex2Count); ! fprintf (file, "table line/bysquare2 %d first[%d] last\n", ! RoadMapLineActive->LineBySquare2Count, ! ROADMAP_CATEGORY_RANGE); } --- 161,175 ---- static void rdmxchange_line_export_head (FILE *file) { ! fprintf (file, "table line/data %d\n", RoadMapLineActive->LineCount); ! fprintf (file, "table line/bysquare1 %d\n", ! RoadMapLineActive->LineBySquare1Count); ! fprintf (file, "table line/index2 %d\n", RoadMapLineActive->LineIndex2Count); ! fprintf (file, "table line/bysquare2 %d\n", ! RoadMapLineActive->LineBySquare2Count); } *************** *** 186,211 **** ! fprintf (file, "table line/data\n"); line = RoadMapLineActive->Line; for (i = 0; i < RoadMapLineActive->LineCount; ++i, ++line) { ! fprintf (file, "%d,%d\n", line->from, line->to); } fprintf (file, "\n"); ! fprintf (file, "table line/bysquare1\n"); bysquare = RoadMapLineActive->LineBySquare1; for (i = 0; i < RoadMapLineActive->LineBySquare1Count; ++i, ++bysquare) { for (j = 0; j < ROADMAP_CATEGORY_RANGE; ++j) { ! fprintf (file, "%d,", bysquare->first[j]); } ! fprintf (file, "%d\n", bysquare->last); } fprintf (file, "\n"); ! fprintf (file, "table line/index2\n"); index2 = RoadMapLineActive->LineIndex2; --- 184,212 ---- ! fprintf (file, "table line/data\n" ! "from,to\n"); line = RoadMapLineActive->Line; for (i = 0; i < RoadMapLineActive->LineCount; ++i, ++line) { ! fprintf (file, "%.0d,%.0d\n", line->from, line->to); } fprintf (file, "\n"); ! fprintf (file, "table line/bysquare1\n" ! "first[%d],last\n", ROADMAP_CATEGORY_RANGE); bysquare = RoadMapLineActive->LineBySquare1; for (i = 0; i < RoadMapLineActive->LineBySquare1Count; ++i, ++bysquare) { for (j = 0; j < ROADMAP_CATEGORY_RANGE; ++j) { ! fprintf (file, "%.0d,", bysquare->first[j]); } ! fprintf (file, "%.0d\n", bysquare->last); } fprintf (file, "\n"); ! fprintf (file, "table line/index2\n" ! "index\n"); index2 = RoadMapLineActive->LineIndex2; *************** *** 216,227 **** ! fprintf (file, "table line/bysquare2\n"); bysquare = RoadMapLineActive->LineBySquare2; for (i = 0; i < RoadMapLineActive->LineBySquare2Count; ++i, ++bysquare) { for (j = 0; j < ROADMAP_CATEGORY_RANGE; ++j) { ! fprintf (file, "%d,", bysquare->first[j]); } ! fprintf (file, "%d\n", bysquare->last); } fprintf (file, "\n"); --- 217,229 ---- ! fprintf (file, "table line/bysquare2\n" ! "first[%d],last\n", ROADMAP_CATEGORY_RANGE); bysquare = RoadMapLineActive->LineBySquare2; for (i = 0; i < RoadMapLineActive->LineBySquare2Count; ++i, ++bysquare) { for (j = 0; j < ROADMAP_CATEGORY_RANGE; ++j) { ! fprintf (file, "%.0d,", bysquare->first[j]); } ! fprintf (file, "%.0d\n", bysquare->last); } fprintf (file, "\n"); |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:53:37
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv967 Modified Files: rdmxchange_index.c Log Message: Small improvements to the .rdx format Index: rdmxchange_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_index.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_index.c 9 Jan 2006 07:43:39 -0000 1.1 --- rdmxchange_index.c 11 Jan 2006 09:53:28 -0000 1.2 *************** *** 155,196 **** static void rdmxchange_index_export_head (FILE *file) { ! fprintf (file, "table index/authority %d" ! " symbol" ! " path" ! " edges.east" ! " edges.north" ! " edges.west" ! " edges.south" ! " name.first" ! " name.count" ! " territory.first" ! " territory.count\n", RoadMapIndexActive->authority_count); ! fprintf (file, "table index/territory %d" ! " wtid" ! " name" ! " path" ! " edges.east" ! " edges.north" ! " edges.west" ! " edges.south" ! " map.first" ! " map.count" ! " city.first" ! " city.count" ! " postal.low" ! " postal.high\n", RoadMapIndexActive->territory_count); ! fprintf (file, "table index/map %d" ! " class" ! " file\n", RoadMapIndexActive->map_count); ! fprintf (file, "table index/name %d index\n", RoadMapIndexActive->name_count); ! fprintf (file, "table index/city %d index\n", RoadMapIndexActive->city_count); } --- 155,171 ---- static void rdmxchange_index_export_head (FILE *file) { ! fprintf (file, "table index/authority %d\n", RoadMapIndexActive->authority_count); ! fprintf (file, "table index/territory %d\n", RoadMapIndexActive->territory_count); ! fprintf (file, "table index/map %d\n", RoadMapIndexActive->map_count); ! fprintf (file, "table index/name %d\n", RoadMapIndexActive->name_count); ! fprintf (file, "table index/city %d\n", RoadMapIndexActive->city_count); } *************** *** 207,257 **** ! fprintf (file, "table index/authority\n"); authority = RoadMapIndexActive->authority; for (i = 0; i < RoadMapIndexActive->authority_count; ++i) { ! fprintf (file, "%d,%d,", authority[i].symbol, authority[i].pathname); ! fprintf (file, "%d,%d,%d,%d,", authority[i].edges.east, ! authority[i].edges.north, ! authority[i].edges.west, ! authority[i].edges.south); ! fprintf (file, "%d,%d,", authority[i].name_first, ! authority[i].name_count); ! fprintf (file, "%d,%d\n", authority[i].territory_first, ! authority[i].territory_count); } fprintf (file, "\n"); ! fprintf (file, "table index/territory\n"); territory = RoadMapIndexActive->territory; for (i = 0; i < RoadMapIndexActive->territory_count; ++i) { ! fprintf (file, "%d,", territory[i].wtid); ! fprintf (file, "%d,%d,", territory[i].name, territory[i].pathname); ! fprintf (file, "%d,%d,%d,%d,", territory[i].edges.east, ! territory[i].edges.north, ! territory[i].edges.west, ! territory[i].edges.south); ! fprintf (file, "%d,%d,", territory[i].map_first, ! territory[i].map_count); ! fprintf (file, "%d,%d,", territory[i].city_first, ! territory[i].city_count); ! fprintf (file, "%d,%d\n", territory[i].postal_low, ! territory[i].postal_high); } fprintf (file, "\n"); ! fprintf (file, "table index/map\n"); map = RoadMapIndexActive->map; for (i = 0; i < RoadMapIndexActive->map_count; ++i) { ! fprintf (file, "%d,%d\n", map[i].class, map[i].filename); } fprintf (file, "\n"); ! fprintf (file, "table index/name\n"); name = RoadMapIndexActive->name; --- 182,258 ---- ! fprintf (file, "table index/authority\n" ! "symbol," ! "path," ! "edges.east," ! "edges.north," ! "edges.west," ! "edges.south," ! "name.first," ! "name.count," ! "territory.first," ! "territory.count\n"); authority = RoadMapIndexActive->authority; for (i = 0; i < RoadMapIndexActive->authority_count; ++i) { ! fprintf (file, "%.0d,%.0d,", authority[i].symbol, authority[i].pathname); ! fprintf (file, "%.0d,%.0d,%.0d,%.0d,", authority[i].edges.east, ! authority[i].edges.north, ! authority[i].edges.west, ! authority[i].edges.south); ! fprintf (file, "%.0d,%.0d,", authority[i].name_first, ! authority[i].name_count); ! fprintf (file, "%.0d,%.0d\n", authority[i].territory_first, ! authority[i].territory_count); } fprintf (file, "\n"); ! fprintf (file, "table index/territory\n" ! "wtid," ! "name," ! "path," ! "edges.east," ! "edges.north," ! "edges.west," ! "edges.south," ! "map.first," ! "map.count," ! "city.first," ! "city.count," ! "postal.low," ! "postal.high\n"); territory = RoadMapIndexActive->territory; for (i = 0; i < RoadMapIndexActive->territory_count; ++i) { ! fprintf (file, "%.0d,", territory[i].wtid); ! fprintf (file, "%.0d,%.0d,", territory[i].name, ! territory[i].pathname); ! fprintf (file, "%.0d,%.0d,%.0d,%.0d,", territory[i].edges.east, ! territory[i].edges.north, ! territory[i].edges.west, ! territory[i].edges.south); ! fprintf (file, "%.0d,%.0d,", territory[i].map_first, ! territory[i].map_count); ! fprintf (file, "%.0d,%.0d,", territory[i].city_first, ! territory[i].city_count); ! fprintf (file, "%.0d,%.0d\n", territory[i].postal_low, ! territory[i].postal_high); } fprintf (file, "\n"); ! fprintf (file, "table index/map\n" ! "class,file\n"); map = RoadMapIndexActive->map; for (i = 0; i < RoadMapIndexActive->map_count; ++i) { ! fprintf (file, "%.0d,%.0d\n", map[i].class, map[i].filename); } fprintf (file, "\n"); ! fprintf (file, "table index/name\n" ! "index\n"); name = RoadMapIndexActive->name; *************** *** 262,266 **** ! fprintf (file, "table index/city\n"); city = RoadMapIndexActive->city; --- 263,268 ---- ! fprintf (file, "table index/city\n" ! "index\n"); city = RoadMapIndexActive->city; |
From: Pascal F M. <pas...@us...> - 2006-01-11 09:53:12
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv854 Modified Files: rdmxchange_dictionary.c Log Message: Small improvements to the .rdx format Index: rdmxchange_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmxchange_dictionary.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmxchange_dictionary.c 9 Jan 2006 07:43:23 -0000 1.1 --- rdmxchange_dictionary.c 11 Jan 2006 09:52:59 -0000 1.2 *************** *** 158,174 **** for (volume = DictionaryVolume; volume != NULL; volume = volume->next) { ! fprintf (file, "table string/%s/node %d character type index\n", volume->name, volume->node_count); ! fprintf (file, "table string/%s/tree %d character type index\n", volume->name, volume->tree_count); ! fprintf (file, "table string/%s/data %d text\n", volume->name, volume->size); ! fprintf (file, "table string/%s/index %d offset\n", volume->name, volume->string_count); --- 158,174 ---- for (volume = DictionaryVolume; volume != NULL; volume = volume->next) { ! fprintf (file, "table string/%s/node %d\n", volume->name, volume->node_count); ! fprintf (file, "table string/%s/tree %d\n", volume->name, volume->tree_count); ! fprintf (file, "table string/%s/data %d\n", volume->name, volume->size); ! fprintf (file, "table string/%s/index %d\n", volume->name, volume->string_count); *************** *** 190,216 **** for (volume = DictionaryVolume; volume != NULL; volume = volume->next) { ! fprintf (file, "table string/%s/node\n", volume->name); node = volume->node; for (i = 0; i < volume->node_count; ++i, ++node) { if (node->character == 0) { ! fprintf (file, ",%d,%d\n", node->type, node->index); continue; } ! fprintf (file, "%c,%d,%d\n", node->character, node->type, node->index); } fprintf (file, "\n"); ! fprintf (file, "table string/%s/tree\n", volume->name); tree = volume->tree; for (i = 0; i < volume->tree_count; ++i, ++tree) { ! fprintf (file, "%d,%d,%d\n", tree->first, tree->count, tree->position); } fprintf (file, "\n"); ! fprintf (file, "table string/%s/data\n", volume->name); data = volume->data + 1; /* Skip the first (empty) string. */ data_end = volume->data + volume->size; --- 190,223 ---- for (volume = DictionaryVolume; volume != NULL; volume = volume->next) { ! fprintf (file, "table string/%s/node\n" ! "character,type,index\n", volume->name); node = volume->node; for (i = 0; i < volume->node_count; ++i, ++node) { if (node->character == 0) { ! fprintf (file, ",%.0d,%.0d\n", node->type, node->index); continue; } ! fprintf (file, "%c,%.0d,%.0d\n", node->character, ! node->type, ! node->index); } fprintf (file, "\n"); ! fprintf (file, "table string/%s/tree\n" ! "first,count,position\n", volume->name); tree = volume->tree; for (i = 0; i < volume->tree_count; ++i, ++tree) { ! fprintf (file, "%.0d,%.0d,%.0d\n", tree->first, ! tree->count, ! tree->position); } fprintf (file, "\n"); ! fprintf (file, "table string/%s/data\n" ! "text\n", volume->name); data = volume->data + 1; /* Skip the first (empty) string. */ data_end = volume->data + volume->size; *************** *** 222,226 **** ! fprintf (file, "table string/%s/index\n", volume->name); index = volume->string_index; --- 229,234 ---- ! fprintf (file, "table string/%s/index\n" ! "offset\n", volume->name); index = volume->string_index; |
From: Paul F. <pg...@us...> - 2006-01-09 17:15:14
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15202/gpx Modified Files: util.c Log Message: safety fix for null gmtime() returns, from gpsbabel mailing list Index: util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/util.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** util.c 7 Dec 2005 14:21:09 -0000 1.1 --- util.c 9 Jan 2006 17:15:06 -0000 1.2 *************** *** 445,450 **** char *format; ! if (!tm) return; if (long_or_short == XML_LONG_TIME) --- 445,452 ---- char *format; ! if (!tm) { ! *time_string = 0; return; + } if (long_or_short == XML_LONG_TIME) *************** *** 466,475 **** char time_string[64]; xml_fill_in_time(time_string, timep, XML_LONG_TIME); ! fprintf(ofd, "%s<%s>%s</%s>\n", ! indent, ! elname, ! time_string, ! elname ! ); } --- 468,479 ---- char time_string[64]; xml_fill_in_time(time_string, timep, XML_LONG_TIME); ! if (*time_string) { ! fprintf(ofd, "%s<%s>%s</%s>\n", ! indent, ! elname, ! time_string, ! elname ! ); ! } } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:43
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15464 Added Files: rdmxchange_square.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_square.c --- /* rdmxchange_square.c - Export a map area, divided in small squares. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" #include "roadmap_db_square.h" static char *RoadMapSquareType = "RoadMapSquareContext"; typedef struct { char *type; RoadMapGlobal *SquareGlobal; RoadMapSquare *Square; int SquareCount; } RoadMapSquareContext; static RoadMapSquareContext *RoadMapSquareActive = NULL; static void rdmxchange_square_register_export (void); static void *rdmxchange_square_map (roadmap_db *root) { RoadMapSquareContext *context; roadmap_db *global_table; roadmap_db *square_table; context = malloc(sizeof(RoadMapSquareContext)); roadmap_check_allocated(context); context->type = RoadMapSquareType; global_table = roadmap_db_get_subsection (root, "global"); square_table = roadmap_db_get_subsection (root, "data"); context->SquareGlobal = (RoadMapGlobal *) roadmap_db_get_data (global_table); context->Square = (RoadMapSquare *) roadmap_db_get_data (square_table); context->SquareCount = roadmap_db_get_count (square_table); rdmxchange_square_register_export(); return context; } static void rdmxchange_square_activate (void *context) { RoadMapSquareContext *square_context = (RoadMapSquareContext *) context; if ((square_context != NULL) && (square_context->type != RoadMapSquareType)) { roadmap_log(ROADMAP_FATAL, "cannot unmap (bad context type)"); } RoadMapSquareActive = square_context; } static void rdmxchange_square_unmap (void *context) { RoadMapSquareContext *square_context = (RoadMapSquareContext *) context; if (square_context->type != RoadMapSquareType) { roadmap_log(ROADMAP_FATAL, "cannot unmap (bad context type)"); } if (RoadMapSquareActive == square_context) { RoadMapSquareActive = NULL; } free(square_context); } roadmap_db_handler RoadMapSquareExport = { "square", rdmxchange_square_map, rdmxchange_square_activate, rdmxchange_square_unmap }; static void rdmxchange_square_export_head (FILE *file) { fprintf (file, "table square/global 1" " edges.east" " edges.north" " edges.west" " edges.south" " step.longitude" " step.latitude" " squares.count\n"); fprintf (file, "table square/data %d" " edges.east" " edges.north" " edges.west" " edges.south" " points.count" " position\n", RoadMapSquareActive->SquareCount); } static void rdmxchange_square_export_data (FILE *file) { int i; RoadMapSquare *square; fprintf (file, "table square/global\n"); fprintf (file, "%d,%d,%d,%d,", RoadMapSquareActive->SquareGlobal->edges.east, RoadMapSquareActive->SquareGlobal->edges.north, RoadMapSquareActive->SquareGlobal->edges.west, RoadMapSquareActive->SquareGlobal->edges.south); fprintf (file, "%d,%d,%d,%d,%d\n\n", RoadMapSquareActive->SquareGlobal->step_longitude, RoadMapSquareActive->SquareGlobal->step_latitude, RoadMapSquareActive->SquareGlobal->count_longitude, RoadMapSquareActive->SquareGlobal->count_latitude, RoadMapSquareActive->SquareGlobal->count_squares); fprintf (file, "table square/data\n"); square = RoadMapSquareActive->Square; for (i = 0; i < RoadMapSquareActive->SquareCount; ++i, ++square) { fprintf (file, "%d,%d,%d,%d,", square->edges.east, square->edges.north, square->edges.west, square->edges.south); fprintf (file, "%d,%d\n", square->count_points, square->position); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeSquareExport = { "square", rdmxchange_square_export_head, rdmxchange_square_export_data }; static void rdmxchange_square_register_export (void) { rdmxchange_main_register_export (&RdmXchangeSquareExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:33
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15447 Added Files: rdmxchange_shape.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_shape.c --- /* rdmxchange_shape.c - export the map shape points. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SYNOPSYS: * * int roadmap_shape_in_square (int square, int *first, int *last); * int roadmap_shape_of_line (int line, int begin, int end, * int *first, int *last); * void roadmap_shape_get_position (int shape, RoadMapPosition *position); * * These functions are used to retrieve the shape points that belong to a line. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" #include "roadmap_db_shape.h" static char *RoadMapShapeType = "RoadMapShapeContext"; typedef struct { char *type; RoadMapShape *Shape; int ShapeCount; RoadMapShapeByLine *ShapeByLine; int ShapeByLineCount; RoadMapShapeBySquare *ShapeBySquare; int ShapeBySquareCount; } RoadMapShapeContext; static RoadMapShapeContext *RoadMapShapeActive = NULL; static void rdmxchange_shape_register_export (void); static void *rdmxchange_shape_map (roadmap_db *root) { RoadMapShapeContext *context; roadmap_db *shape_table; roadmap_db *line_table; roadmap_db *square_table; context = malloc(sizeof(RoadMapShapeContext)); roadmap_check_allocated(context); context->type = RoadMapShapeType; shape_table = roadmap_db_get_subsection (root, "data"); line_table = roadmap_db_get_subsection (root, "byline"); square_table = roadmap_db_get_subsection (root, "bysquare"); context->Shape = (RoadMapShape *) roadmap_db_get_data (shape_table); context->ShapeCount = roadmap_db_get_count (shape_table); if (roadmap_db_get_size (shape_table) != context->ShapeCount * sizeof(RoadMapShape)) { roadmap_log (ROADMAP_FATAL, "invalid shape/data structure"); } context->ShapeByLine = (RoadMapShapeByLine *) roadmap_db_get_data (line_table); context->ShapeByLineCount = roadmap_db_get_count (line_table); if (roadmap_db_get_size (line_table) != context->ShapeByLineCount * sizeof(RoadMapShapeByLine)) { roadmap_log (ROADMAP_FATAL, "invalid shape/byline structure"); } context->ShapeBySquare = (RoadMapShapeBySquare *) roadmap_db_get_data (square_table); context->ShapeBySquareCount = roadmap_db_get_count (square_table); if (roadmap_db_get_size (square_table) != context->ShapeBySquareCount * sizeof(RoadMapShapeBySquare)) { roadmap_log (ROADMAP_FATAL, "invalid shape/bysquare structure"); } rdmxchange_shape_register_export(); return context; } static void rdmxchange_shape_activate (void *context) { RoadMapShapeContext *shape_context = (RoadMapShapeContext *) context; if (shape_context != NULL) { if (shape_context->type != RoadMapShapeType) { roadmap_log (ROADMAP_FATAL, "cannot activate shape (bad type)"); } } RoadMapShapeActive = shape_context; } static void rdmxchange_shape_unmap (void *context) { RoadMapShapeContext *shape_context = (RoadMapShapeContext *) context; if (shape_context->type != RoadMapShapeType) { roadmap_log (ROADMAP_FATAL, "cannot activate shape (bad type)"); } if (RoadMapShapeActive == shape_context) { RoadMapShapeActive = NULL; } free(shape_context); } roadmap_db_handler RoadMapShapeExport = { "shape", rdmxchange_shape_map, rdmxchange_shape_activate, rdmxchange_shape_unmap }; static void rdmxchange_shape_export_head (FILE *file) { fprintf (file, "table shape/bysquare %d first count\n", RoadMapShapeActive->ShapeBySquareCount); fprintf (file, "table shape/byline %d line first count\n", RoadMapShapeActive->ShapeByLineCount); fprintf (file, "table shape/data %d longitude latitude\n", RoadMapShapeActive->ShapeCount); } static void rdmxchange_shape_export_data (FILE *file) { int i; RoadMapShape *point; RoadMapShapeByLine *byline; RoadMapShapeBySquare *bysquare; fprintf (file, "table shape/bysquare\n"); bysquare = RoadMapShapeActive->ShapeBySquare; for (i = 0; i < RoadMapShapeActive->ShapeBySquareCount; ++i, ++bysquare) { fprintf (file, "%d,%d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); fprintf (file, "table shape/byline\n"); byline = RoadMapShapeActive->ShapeByLine; for (i = 0; i < RoadMapShapeActive->ShapeByLineCount; ++i, ++byline) { fprintf (file, "%d,%d,%d\n", byline->line, byline->first, byline->count); } fprintf (file, "\n"); fprintf (file, "table shape/data\n"); point = RoadMapShapeActive->Shape; for (i = 0; i < RoadMapShapeActive->ShapeCount; ++i, ++point) { fprintf (file, "%d,%d\n", point->delta_longitude, point->delta_latitude); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeShapeExport = { "shape", rdmxchange_shape_export_head, rdmxchange_shape_export_data }; static void rdmxchange_shape_register_export (void) { rdmxchange_main_register_export (&RdmXchangeShapeExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15425 Added Files: rdmxchange_polygon.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_polygon.c --- /* rdmxchange_polygon.c - Export the map polygons. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" #include "roadmap_db_polygon.h" static char *RoadMapPolygonType = "RoadMapPolygonContext"; typedef struct { char *type; RoadMapPolygon *Polygon; int PolygonCount; RoadMapPolygonPoint *PolygonPoint; int PolygonPointCount; } RoadMapPolygonContext; static RoadMapPolygonContext *RoadMapPolygonActive = NULL; static void rdmxchange_polygon_register_export (void); static void *rdmxchange_polygon_map (roadmap_db *root) { RoadMapPolygonContext *context; roadmap_db *head_table; roadmap_db *point_table; context = malloc (sizeof(RoadMapPolygonContext)); roadmap_check_allocated(context); context->type = RoadMapPolygonType; head_table = roadmap_db_get_subsection (root, "head"); point_table = roadmap_db_get_subsection (root, "point"); context->Polygon = (RoadMapPolygon *) roadmap_db_get_data (head_table); context->PolygonCount = roadmap_db_get_count (head_table); if (roadmap_db_get_size (head_table) != context->PolygonCount * sizeof(RoadMapPolygon)) { roadmap_log (ROADMAP_FATAL, "invalid polygon/head structure"); } context->PolygonPoint = (RoadMapPolygonPoint *) roadmap_db_get_data (point_table); context->PolygonPointCount = roadmap_db_get_count (point_table); if (roadmap_db_get_size (point_table) != context->PolygonPointCount * sizeof(RoadMapPolygonPoint)) { roadmap_log (ROADMAP_FATAL, "invalid polygon/point structure"); } rdmxchange_polygon_register_export(); return context; } static void rdmxchange_polygon_activate (void *context) { RoadMapPolygonContext *polygon_context = (RoadMapPolygonContext *) context; if ((polygon_context != NULL) && (polygon_context->type != RoadMapPolygonType)) { roadmap_log (ROADMAP_FATAL, "cannot activate (invalid context type)"); } RoadMapPolygonActive = polygon_context; } static void rdmxchange_polygon_unmap (void *context) { RoadMapPolygonContext *polygon_context = (RoadMapPolygonContext *) context; if (polygon_context->type != RoadMapPolygonType) { roadmap_log (ROADMAP_FATAL, "cannot activate (invalid context type)"); } if (RoadMapPolygonActive == polygon_context) { RoadMapPolygonActive = NULL; } free (polygon_context); } roadmap_db_handler RoadMapPolygonExport = { "polygon", rdmxchange_polygon_map, rdmxchange_polygon_activate, rdmxchange_polygon_unmap }; static void rdmxchange_polygon_export_head (FILE *file) { fprintf (file, "table polygon/head %d" " points.first" " points.count" " name" " layer" " edges.east" " edges.north" " edges.west" " edges.south\n", RoadMapPolygonActive->PolygonCount); fprintf (file, "table polygon/points %d index\n", RoadMapPolygonActive->PolygonPointCount); } static void rdmxchange_polygon_export_data (FILE *file) { int i; RoadMapPolygon *polygon; RoadMapPolygonPoint *point; fprintf (file, "table polygon/head\n"); polygon = RoadMapPolygonActive->Polygon; for (i = 0; i < RoadMapPolygonActive->PolygonCount; ++i, ++polygon) { fprintf (file, "%d,%d,", polygon->first, polygon->count); fprintf (file, "%d,%d,", polygon->name, polygon->cfcc); fprintf (file, "%d,%d,%d,%d\n", polygon->east, polygon->north, polygon->west, polygon->south); } fprintf (file, "\n"); fprintf (file, "table polygon/point\n"); point = RoadMapPolygonActive->PolygonPoint; for (i = 0; i < RoadMapPolygonActive->PolygonPointCount; ++i, ++point) { fprintf (file, "%d\n", point->point); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangePolygonExport = { "point", rdmxchange_polygon_export_head, rdmxchange_polygon_export_data }; static void rdmxchange_polygon_register_export (void) { rdmxchange_main_register_export (&RdmXchangePolygonExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:18
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15406 Added Files: rdmxchange_point.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_point.c --- /* rdmxchange_point.c - Export the points that define tiger lines. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" #include "roadmap_db_point.h" typedef struct { char *type; RoadMapPoint *Point; int PointCount; RoadMapPointBySquare *BySquare; int BySquareCount; } RoadMapPointContext; static RoadMapPointContext *RoadMapPointActive = NULL; static char *RoadMapPointType = "RoadMapPointContext"; static void rdmxchange_point_register_export (void); static void *rdmxchange_point_map (roadmap_db *root) { roadmap_db *point_table; roadmap_db *bysquare_table; RoadMapPointContext *context; context = malloc (sizeof(RoadMapPointContext)); roadmap_check_allocated(context); context->type = RoadMapPointType; bysquare_table = roadmap_db_get_subsection (root, "bysquare"); point_table = roadmap_db_get_subsection (root, "data"); context->BySquare = (RoadMapPointBySquare *) roadmap_db_get_data (bysquare_table); context->Point = (RoadMapPoint *) roadmap_db_get_data (point_table); context->BySquareCount = roadmap_db_get_count (bysquare_table); context->PointCount = roadmap_db_get_count (point_table); if (roadmap_db_get_size(bysquare_table) != context->BySquareCount * sizeof(RoadMapPointBySquare)) { roadmap_log (ROADMAP_FATAL, "invalid point/bysquare structure"); } if (roadmap_db_get_size(point_table) != context->PointCount * sizeof(RoadMapPoint)) { roadmap_log (ROADMAP_FATAL, "invalid point/data structure"); } rdmxchange_point_register_export(); return context; } static void rdmxchange_point_activate (void *context) { RoadMapPointContext *point_context = (RoadMapPointContext *) context; if ((point_context != NULL) && (point_context->type != RoadMapPointType)) { roadmap_log (ROADMAP_FATAL, "cannot activate (invalid context type)"); } RoadMapPointActive = point_context; } static void rdmxchange_point_unmap (void *context) { RoadMapPointContext *point_context = (RoadMapPointContext *) context; if (point_context == RoadMapPointActive) { RoadMapPointActive = NULL; } free (point_context); } roadmap_db_handler RoadMapPointExport = { "point", rdmxchange_point_map, rdmxchange_point_activate, rdmxchange_point_unmap }; static void rdmxchange_point_export_head (FILE *file) { fprintf (file, "table point/data %d longitude latitude\n", RoadMapPointActive->PointCount); fprintf (file, "table point/bysquare %d first count\n", RoadMapPointActive->BySquareCount); } static void rdmxchange_point_export_data (FILE *file) { int i; RoadMapPoint *point; RoadMapPointBySquare *bysquare; fprintf (file, "table point/data\n"); point = RoadMapPointActive->Point; for (i = 0; i < RoadMapPointActive->PointCount; ++i, ++point) { fprintf (file, "%d,%d\n", point->longitude, point->latitude); } fprintf (file, "\n"); fprintf (file, "table point/bysquare\n"); bysquare = RoadMapPointActive->BySquare; for (i = 0; i < RoadMapPointActive->BySquareCount; ++i, ++bysquare) { fprintf (file, "%d,%d\n", bysquare->first, bysquare->count); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangePointExport = { "point", rdmxchange_point_export_head, rdmxchange_point_export_data }; static void rdmxchange_point_register_export (void) { rdmxchange_main_register_export (&RdmXchangePointExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:09
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15382 Added Files: rdmxchange_metadata.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_metadata.c --- /* rdmxchange_metadata.c - Export the map metadata information. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" #include "roadmap_db_metadata.h" static const char *RoadMapMetadataType = "RoadMapMetadataContext"; typedef struct { const char *type; RoadMapAttribute *Attributes; int AttributesCount; RoadMapString *Values; int ValuesCount; } RoadMapMetadataContext; static RoadMapMetadataContext *RoadMapMetadataActive = NULL; static void rdmxchange_metadata_register_export (void); static void *rdmxchange_metadata_map (roadmap_db *root) { RoadMapMetadataContext *context; roadmap_db *attributes_table; roadmap_db *values_table; context = (RoadMapMetadataContext *) malloc (sizeof(RoadMapMetadataContext)); if (context == NULL) { roadmap_log (ROADMAP_ERROR, "no more memory"); return NULL; } context->type = RoadMapMetadataType; attributes_table = roadmap_db_get_subsection (root, "attributes"); values_table = roadmap_db_get_subsection (root, "values"); context->Attributes = (RoadMapAttribute *) roadmap_db_get_data (attributes_table); context->AttributesCount = roadmap_db_get_count (attributes_table); context->Values = (RoadMapString *) roadmap_db_get_data (values_table); context->ValuesCount = roadmap_db_get_count (values_table); if (roadmap_db_get_size (attributes_table) != context->AttributesCount * sizeof(RoadMapAttribute)) { roadmap_log (ROADMAP_ERROR, "invalid metadata/attributes structure"); goto rdmxchange_metadata_map_abort; } if (roadmap_db_get_size (values_table) != context->ValuesCount * sizeof(RoadMapString)) { roadmap_log (ROADMAP_ERROR, "invalid metadata/values structure"); goto rdmxchange_metadata_map_abort; } rdmxchange_metadata_register_export(); return context; rdmxchange_metadata_map_abort: free(context); return NULL; } static void rdmxchange_metadata_activate (void *context) { RoadMapMetadataContext *this = (RoadMapMetadataContext *) context; if (this != NULL) { if (this->type != RoadMapMetadataType) { roadmap_log (ROADMAP_FATAL, "invalid metadata context activated"); } } RoadMapMetadataActive = this; } static void rdmxchange_metadata_unmap (void *context) { RoadMapMetadataContext *this = (RoadMapMetadataContext *) context; if (this->type != RoadMapMetadataType) { roadmap_log (ROADMAP_FATAL, "unmapping invalid line context"); } if (RoadMapMetadataActive == this) { RoadMapMetadataActive = NULL; } free (this); } roadmap_db_handler RoadMapMetadataExport = { "metadata", rdmxchange_metadata_map, rdmxchange_metadata_activate, rdmxchange_metadata_unmap }; static void rdmxchange_metadata_export_head (FILE *file) { if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ fprintf (file, "table metadata/attributes %d" " category" " name" " value.first" " value.count\n", RoadMapMetadataActive->AttributesCount); fprintf (file, "table metadata/values %d index\n", RoadMapMetadataActive->ValuesCount); } static void rdmxchange_metadata_export_data (FILE *file) { int i; RoadMapAttribute *attributes; RoadMapString *values; if (RoadMapMetadataActive == NULL) return; /* No such table in that file. */ fprintf (file, "table metadata/attributes\n"); attributes = RoadMapMetadataActive->Attributes; for (i = 0; i < RoadMapMetadataActive->AttributesCount; ++i) { fprintf (file, "%d,%d,%d,%d\n", attributes[i].category, attributes[i].name, attributes[i].value_first, attributes[i].value_count); } fprintf (file, "\n"); fprintf (file, "table metadata/values\n"); values = RoadMapMetadataActive->Values; for (i = 0; i < RoadMapMetadataActive->ValuesCount; ++i) { fprintf (file, "%d\n", values[i]); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeMetadataExport = { "metadata", rdmxchange_metadata_export_head, rdmxchange_metadata_export_data }; static void rdmxchange_metadata_register_export (void) { rdmxchange_main_register_export (&RdmXchangeMetadataExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:44:02
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15348 Added Files: rdmxchange_main.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_main.c --- /* rdmxchange_main.c - a tool to import/export RoadMap map file. * * LICENSE: * * Copyright 2006 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * The purpose of the rdmxchange tool is to convert map and index files * both way between the binary representation (.rdm, used by roadmap) and * the ascii representation (.rdx, used for download and architecture * independent). */ #include <string.h> #include <stdio.h> #include <stdlib.h> #include "roadmap.h" #include "roadmap_path.h" #include "roadmap_dbread.h" #include "rdmxchange.h" static roadmap_db_model *RdmMapModel = NULL; static roadmap_db_model *RdmIndexModel = NULL; static char *RdmXchangePath = "."; static int RdmXchangeVerbose = 0; #define RDMXCHANGE_MAX_MODULES 256 static RdmXchangeExport *RdmXchangeExportList[RDMXCHANGE_MAX_MODULES]; static int RdmXchangeExportRegistered = 0; void rdmxchange_main_register_export (RdmXchangeExport *export) { if (RdmXchangeExportRegistered >= RDMXCHANGE_MAX_MODULES) { fprintf (stderr, "too many tables\n"); exit(1); } RdmXchangeExportList[RdmXchangeExportRegistered++] = export; } /* Main program. ----------------------------------------------------------- */ int main (int argc, const char **argv) { int i; /* TBD RdmMapModel = roadmap_db_register (RdmMapModel, "zip", &RoadMapZipExport); RdmMapModel = roadmap_db_register (RdmMapModel, "street", &RoadMapStreetExport); RdmMapModel = roadmap_db_register (RdmMapModel, "range", &RoadMapRangeExport); */ RdmMapModel = roadmap_db_register (RdmMapModel, "polygon", &RoadMapPolygonExport); RdmMapModel = roadmap_db_register (RdmMapModel, "shape", &RoadMapShapeExport); RdmMapModel = roadmap_db_register (RdmMapModel, "line", &RoadMapLineExport); RdmMapModel = roadmap_db_register (RdmMapModel, "point", &RoadMapPointExport); RdmMapModel = roadmap_db_register (RdmMapModel, "square", &RoadMapSquareExport); RdmMapModel = roadmap_db_register (RdmMapModel, "metadata", &RoadMapMetadataExport); RdmMapModel = roadmap_db_register (RdmMapModel, "string", &RoadMapDictionaryExport); RdmIndexModel = roadmap_db_register (RdmIndexModel, "index", &RoadMapIndexExport); RdmIndexModel = roadmap_db_register (RdmIndexModel, "metadata", &RoadMapMetadataExport); RdmIndexModel = roadmap_db_register (RdmIndexModel, "string", &RoadMapDictionaryExport); for (i = 1; i < argc; ++i) { if (argv[i][0] == '-') { /* This is an option. */ if (strcasecmp (argv[i], "-h") == 0 || strcasecmp (argv[i], "--help") == 0) { printf ("Usage: rdmxchange [-v|--verbose] file ...\n"); exit(0); } if (strcasecmp (argv[i], "-v") == 0 || strcasecmp (argv[i], "--verbose") == 0) { RdmXchangeVerbose = 1; } else if (strncasecmp (argv[i], "--output=", 9) == 0) { RdmXchangePath = strdup(argv[i]+9); } else { fprintf (stderr, "invalid option %s\n", argv[i]); exit(1); } } else { /* This is a file to import or export. */ FILE *output; char *fullname; char *basename = strdup(roadmap_path_skip_directories (argv[i])); char *extension = strrchr (basename, '.'); if (extension == NULL) { fprintf (stderr, "invalid input file %s\n", argv[i]); exit(1); } if (strcmp (extension, ".rdm") == 0) { /* This is a file to export. */ int export; roadmap_db_model *model; if (strcmp (basename, "index.rdm") == 0) { model = RdmIndexModel; } else if (strcmp (basename, "usdir.rdm") == 0) { fprintf (stderr, "obsolete US directory file found. Skipped.\n"); free (basename); continue; } else { model = RdmMapModel; } RdmXchangeExportRegistered = 0; if (! roadmap_db_open ("", argv[i], model)) { fprintf (stderr, "cannot open map database %s", argv[i]); exit(1); } roadmap_db_activate ("", argv[i]); strcpy (extension, ".rdx"); fullname = roadmap_path_join (RdmXchangePath, basename); output = fopen (fullname, "w"); if (output == NULL) { fprintf (stderr, "cannot open output file %s", fullname); exit(1); } for (export = 0; export < RdmXchangeExportRegistered; ++export) { RdmXchangeExportList[export]->head (output); } fprintf (output, "\n"); for (export = 0; export < RdmXchangeExportRegistered; ++export) { RdmXchangeExportList[export]->data (output); } fclose (output); roadmap_db_close ("", argv[i]); roadmap_path_free (fullname); } else if (strcmp (argv[i], ".rdx") == 0) { /* This is a file to import. */ } else { fprintf (stderr, "invalid input file %s\n", argv[i]); exit(1); } free (basename); } } roadmap_db_end (); return 0; } |