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-16 20:43:47
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1845 Modified Files: buildmap_line.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** buildmap_line.c 14 Nov 2005 06:58:38 -0000 1.4 --- buildmap_line.c 16 Jan 2006 20:43:39 -0000 1.5 *************** *** 23,29 **** * SYNOPSYS: * - * void buildmap_line_initialize (void); * int buildmap_line_add (int tlid, int cfcc, int from, int to); ! * void buildmap_line_sort (void); * int buildmap_line_get_sorted (int line); * void buildmap_line_find_sorted (int tlid); --- 23,28 ---- * SYNOPSYS: * * int buildmap_line_add (int tlid, int cfcc, int from, int to); ! * * int buildmap_line_get_sorted (int line); * void buildmap_line_find_sorted (int tlid); *************** *** 34,40 **** * (int line, int *longitude, int *latitude); * void buildmap_line_get_square_sorted (int line); - * void buildmap_line_save (void); - * void buildmap_line_summary (void); - * void buildmap_line_reset (void); * * These functions are used to build a table of lines from --- 33,36 ---- *************** *** 78,82 **** ! void buildmap_line_initialize (void) { LineById = roadmap_hash_new ("LineById", BUILDMAP_BLOCK); --- 74,81 ---- ! static void buildmap_line_register (void); ! ! ! static void buildmap_line_initialize (void) { LineById = roadmap_hash_new ("LineById", BUILDMAP_BLOCK); *************** *** 88,91 **** --- 87,92 ---- LineCount = 0; + + buildmap_line_register(); } *************** *** 98,101 **** --- 99,105 ---- + if (LineById == NULL) buildmap_line_initialize(); + + block = LineCount / BUILDMAP_BLOCK; offset = LineCount % BUILDMAP_BLOCK; *************** *** 382,386 **** ! void buildmap_line_save (void) { int i; --- 386,390 ---- ! static void buildmap_line_save (void) { int i; *************** *** 546,550 **** ! void buildmap_line_summary (void) { fprintf (stderr, --- 550,554 ---- ! static void buildmap_line_summary (void) { fprintf (stderr, *************** *** 554,558 **** ! void buildmap_line_reset (void) { int i; --- 558,562 ---- ! static void buildmap_line_reset (void) { int i; *************** *** 574,578 **** --- 578,597 ---- LineCrossingCount = 0; + roadmap_hash_delete (LineById); LineById = NULL; } + + static buildmap_db_module BuildMapLineModule = { + "line", + buildmap_line_sort, + buildmap_line_save, + buildmap_line_summary, + buildmap_line_reset + }; + + + static void buildmap_line_register (void) { + buildmap_db_register (&BuildMapLineModule); + } + |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:42:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1691 Modified Files: buildmap_index.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_index.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_index.c 3 Jan 2006 04:13:29 -0000 1.2 --- buildmap_index.c 16 Jan 2006 20:42:49 -0000 1.3 *************** *** 35,42 **** * void buildmap_index_add_postal_code (unsigned int code); * - * void buildmap_index_sort (void); - * void buildmap_index_save (void); - * void buildmap_index_summary (void); - * * These functions are used to build a table of counties from * the census bureau list of FIPS code. --- 35,38 ---- *************** *** 152,155 **** --- 148,154 ---- + static void buildmap_index_register (void); + + void buildmap_index_initialize (const char *path) { *************** *** 169,172 **** --- 168,173 ---- BuildMapBasePath = strdup(path); BuildMapBaseLength = strlen(BuildMapBasePath); + + buildmap_index_register (); } *************** *** 533,537 **** ! void buildmap_index_sort (void) { int index; --- 534,538 ---- ! static void buildmap_index_sort (void) { int index; *************** *** 668,672 **** ! void buildmap_index_save (void) { int i; --- 669,673 ---- ! static void buildmap_index_save (void) { int i; *************** *** 808,812 **** ! void buildmap_index_summary (void) { fprintf (stderr, --- 809,813 ---- ! static void buildmap_index_summary (void) { fprintf (stderr, *************** *** 815,816 **** --- 816,831 ---- } + + static buildmap_db_module BuildMapIndexModule = { + "index", + buildmap_index_sort, + buildmap_index_save, + buildmap_index_summary, + NULL + }; + + + static void buildmap_index_register (void) { + buildmap_db_register (&BuildMapIndexModule); + } + |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:42:19
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1571 Modified Files: buildmap_dictionary.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_dictionary.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** buildmap_dictionary.c 14 Nov 2005 06:57:57 -0000 1.4 --- buildmap_dictionary.c 16 Jan 2006 20:42:10 -0000 1.5 *************** *** 24,35 **** * * BuildMapDictionary buildmap_dictionary_open (char *name); * RoadMapString buildmap_dictionary_add * (BuildMapDictionary d, const char *string, int length); * RoadMapString buildmap_dictionary_locate * (BuildMapDictionary d, const char *string); * char *buildmap_dictionary_get (BuildMapDictionary d, RoadMapString index); - * void buildmap_dictionary_save (void); - * void buildmap_dictionary_summary (void); - * void buildmap_dictionary_reset (void); * * These functions are used to build a dictionary of strings from --- 24,34 ---- * * BuildMapDictionary buildmap_dictionary_open (char *name); + * * RoadMapString buildmap_dictionary_add * (BuildMapDictionary d, const char *string, int length); * RoadMapString buildmap_dictionary_locate * (BuildMapDictionary d, const char *string); + * * char *buildmap_dictionary_get (BuildMapDictionary d, RoadMapString index); * * These functions are used to build a dictionary of strings from *************** *** 97,101 **** }; ! #define DICTIONARY_MAX_VOLUME_COUNT 16 static struct dictionary_volume *DictionaryVolume[DICTIONARY_MAX_VOLUME_COUNT]; --- 96,100 ---- }; ! #define DICTIONARY_MAX_VOLUME_COUNT 256 static struct dictionary_volume *DictionaryVolume[DICTIONARY_MAX_VOLUME_COUNT]; *************** *** 105,108 **** --- 104,111 ---- + static void buildmap_dictionary_summary (void); + static void buildmap_dictionary_register (void); + + static void buildmap_dictionary_print_subtree (struct dictionary_volume *dictionary, *************** *** 546,549 **** --- 549,553 ---- struct dictionary_volume *dictionary; + for (i = 0; i < DictionaryVolumeCount; i++) { if (strcmp (name, DictionaryVolume[i]->name) == 0) { *************** *** 552,555 **** --- 556,562 ---- } + if (DictionaryVolumeCount == 0) buildmap_dictionary_register (); + + /* This is a new dictionary volume. */ *************** *** 752,756 **** ! void buildmap_dictionary_summary (void) { int i; --- 759,763 ---- ! static void buildmap_dictionary_summary (void) { int i; *************** *** 803,807 **** ! void buildmap_dictionary_save (void) { int i; --- 810,814 ---- ! static void buildmap_dictionary_save (void) { int i; *************** *** 822,826 **** ! void buildmap_dictionary_reset (void) { int i; --- 829,833 ---- ! static void buildmap_dictionary_reset (void) { int i; *************** *** 843,844 **** --- 850,865 ---- } + + static buildmap_db_module BuildMapDictionaryModule = { + "dictionary", + NULL, + buildmap_dictionary_save, + buildmap_dictionary_summary, + buildmap_dictionary_reset + }; + + + static void buildmap_dictionary_register (void) { + buildmap_db_register (&BuildMapDictionaryModule); + } + |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:40:54
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1406 Modified Files: buildmap_city.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_city.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_city.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_city.c 21 Feb 2003 20:07:10 -0000 1.1.1.1 --- buildmap_city.c 16 Jan 2006 20:40:46 -0000 1.2 *************** *** 23,35 **** * SYNOPSYS: * - * void buildmap_city_initialize (void); * void buildmap_city_add (int fips, int year, RoadMapString name); * * RoadMapString buildmap_city_get_name (int fips); * - * void buildmap_city_save (void); - * void buildmap_city_summary (void); - * void buildmap_city_reset (void); - * * These functions are used to build a table of cities from * the Tiger maps. The objective is double: (1) reduce the size of --- 23,30 ---- *************** *** 69,77 **** ! void buildmap_city_initialize (void) { CityByFips = roadmap_hash_new ("CityByFips", BUILDMAP_BLOCK); CityCount = 0; } --- 64,77 ---- ! static void buildmap_city_register (void); ! ! ! static void buildmap_city_initialize (void) { CityByFips = roadmap_hash_new ("CityByFips", BUILDMAP_BLOCK); CityCount = 0; + + buildmap_city_register(); } *************** *** 85,88 **** --- 85,91 ---- + if (CityByFips == NULL) buildmap_city_initialize(); + + /* First search if that city is not yet known. */ *************** *** 141,144 **** --- 144,149 ---- BuildMapCity *this_city; + if (CityByFips == NULL) return 0; + for (index = roadmap_hash_get_first (CityByFips, fips); index >= 0; *************** *** 156,164 **** ! void buildmap_city_save (void) { ! } ! ! ! void buildmap_city_summary (void) { fprintf (stderr, --- 161,165 ---- ! static void buildmap_city_summary (void) { fprintf (stderr, *************** *** 167,171 **** ! void buildmap_city_reset (void) { int i; --- 168,172 ---- ! static void buildmap_city_reset (void) { int i; *************** *** 180,184 **** --- 181,200 ---- CityCount = 0; + roadmap_hash_delete (CityByFips); CityByFips = NULL; } + + static buildmap_db_module BuildMapCityModule = { + "city", + NULL, + NULL, + buildmap_city_summary, + buildmap_city_reset + }; + + + static void buildmap_city_register (void) { + buildmap_db_register (&BuildMapCityModule); + } + |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:39:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1152 Modified Files: buildmap_area.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_area.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_area.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_area.c 27 Nov 2004 18:30:03 -0000 1.2 --- buildmap_area.c 16 Jan 2006 20:39:24 -0000 1.3 *************** *** 23,27 **** * SYNOPSYS: * - * void buildmap_area_initialize (void); * int buildmap_area_add * (char cfcc, --- 23,26 ---- *************** *** 31,37 **** * RoadMapString fedirs, * int tlid); - * void buildmap_area_sort (void); - * void buildmap_area_save (void); - * void buildmap_area_summary (void); * * These functions are used to build a table of areas from --- 30,33 ---- *************** *** 51,59 **** - void buildmap_area_initialize (void) { - - } - - int buildmap_area_add (char cfcc, --- 47,50 ---- *************** *** 67,83 **** } - - void buildmap_area_sort (void) { - - } - - - void buildmap_area_save (void) { - - } - - - void buildmap_area_summary (void) { - - } - --- 58,59 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:39:03
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1070 Modified Files: buildus_county.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildus_county.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildus_county.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildus_county.h 8 Nov 2004 07:51:39 -0000 1.2 --- buildus_county.h 16 Jan 2006 20:38:55 -0000 1.3 *************** *** 22,31 **** */ ! #ifndef _BUILDUS_COUNTY__H_ ! #define _BUILDUS_COUNTY__H_ #include "roadmap_types.h" - void buildus_county_initialize (void); int buildus_county_add (int fips, RoadMapString name, RoadMapString state_symbol); --- 22,30 ---- */ ! #ifndef INCLUDED__BUILDUS_COUNTY__H ! #define INCLUDED__BUILDUS_COUNTY__H #include "roadmap_types.h" int buildus_county_add (int fips, RoadMapString name, RoadMapString state_symbol); *************** *** 33,40 **** void buildus_county_add_city (int fips, RoadMapString city); void buildus_county_set_position (int fips, const RoadMapArea *edges); - void buildus_county_sort (void); - void buildus_county_save (void); - void buildus_county_summary (void); ! #endif // _BUILDUS_COUNTY__H_ --- 32,36 ---- void buildus_county_add_city (int fips, RoadMapString city); void buildus_county_set_position (int fips, const RoadMapArea *edges); ! #endif // INCLUDED__BUILDUS_COUNTY__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:38:47
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1003 Modified Files: buildmap_zip.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_zip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_zip.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_zip.h 21 Feb 2003 20:07:24 -0000 1.1.1.1 --- buildmap_zip.h 16 Jan 2006 20:38:39 -0000 1.2 *************** *** 22,31 **** */ ! #ifndef _BUILDMAP_ZIP__H_ ! #define _BUILDMAP_ZIP__H_ #include "roadmap_types.h" - void buildmap_zip_initialize (void); void buildmap_zip_set_county (int county_code); --- 22,30 ---- */ ! #ifndef INCLUDED__BUILDMAP_ZIP__H ! #define INCLUDED__BUILDMAP_ZIP__H #include "roadmap_types.h" void buildmap_zip_set_county (int county_code); *************** *** 38,45 **** RoadMapZip buildmap_zip_locate (int zip); ! void buildmap_zip_save (void); ! void buildmap_zip_summary (void); ! void buildmap_zip_reset (void); ! ! #endif // _BUILDMAP_ZIP__H_ --- 37,40 ---- RoadMapZip buildmap_zip_locate (int zip); ! #endif // INCLUDED__BUILDMAP_ZIP__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:38:29
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv951 Modified Files: buildmap_street.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_street.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_street.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_street.h 21 Feb 2003 20:07:22 -0000 1.1.1.1 --- buildmap_street.h 16 Jan 2006 20:38:22 -0000 1.2 *************** *** 22,31 **** */ ! #ifndef _BUILDMAP_STREET__H_ ! #define _BUILDMAP_STREET__H_ #include <stdio.h> - void buildmap_street_initialize (void); int buildmap_street_add (char cfcc, --- 22,30 ---- */ ! #ifndef INCLUDED__BUILDMAP_STREET__H ! #define INCLUDED__BUILDMAP_STREET__H #include <stdio.h> int buildmap_street_add (char cfcc, *************** *** 36,40 **** int line); - void buildmap_street_sort (void); int buildmap_street_get_sorted (int street); void buildmap_street_print_sorted (FILE *file, int street); --- 35,38 ---- *************** *** 42,49 **** int buildmap_street_count (void); ! void buildmap_street_save (void); ! void buildmap_street_summary (void); ! void buildmap_street_reset (void); ! #endif // _BUILDMAP_STREET__H_ --- 40,45 ---- int buildmap_street_count (void); ! void buildmap_street_sort (void); ! #endif // INCLUDED__BUILDMAP_STREET__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:38:11
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv870 Modified Files: buildmap_square.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_square.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_square.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_square.h 21 Feb 2003 20:07:21 -0000 1.1.1.1 --- buildmap_square.h 16 Jan 2006 20:38:02 -0000 1.2 *************** *** 22,34 **** */ ! #ifndef _BUILDMAP_SQUARE__H_ ! #define _BUILDMAP_SQUARE__H_ void buildmap_square_initialize (int minlongitude, int maxlongitude, int minlatitude, int maxlatitude); int buildmap_square_add (int longitude, int latitude); - void buildmap_square_sort (void); short buildmap_square_get_sorted (int squareid); int buildmap_square_get_count (void); --- 22,34 ---- */ ! #ifndef INCLUDED__BUILDMAP_SQUARE__H ! #define INCLUDED__BUILDMAP_SQUARE__H void buildmap_square_initialize (int minlongitude, int maxlongitude, int minlatitude, int maxlatitude); + int buildmap_square_add (int longitude, int latitude); short buildmap_square_get_sorted (int squareid); int buildmap_square_get_count (void); *************** *** 36,43 **** (int square, int *longitude, int *latitude); ! void buildmap_square_save (void); ! void buildmap_square_summary (void); ! void buildmap_square_reset (void); ! #endif // _BUILDMAP_SQUARE__H_ --- 36,41 ---- (int square, int *longitude, int *latitude); ! void buildmap_square_sort (void); ! #endif // INCLUDED__BUILDMAP_SQUARE__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:37:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv710 Modified Files: buildmap_shape.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_shape.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_shape.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_shape.h 21 Feb 2003 20:07:20 -0000 1.1.1.1 --- buildmap_shape.h 16 Jan 2006 20:37:08 -0000 1.2 *************** *** 22,39 **** */ ! #ifndef _BUILDMAP_SHAPE__H_ ! #define _BUILDMAP_SHAPE__H_ #include "roadmap_types.h" - void buildmap_shape_initialize (void); int buildmap_shape_add (int line, int sequence, int longitude, int latitude); ! void buildmap_shape_sort (void); ! ! void buildmap_shape_save (void); ! void buildmap_shape_summary (void); ! void buildmap_shape_reset (void); ! ! #endif // _BUILDMAP_SHAPE__H_ --- 22,32 ---- */ ! #ifndef INCLUDED__BUILDMAP_SHAPE__H ! #define INCLUDED__BUILDMAP_SHAPE__H #include "roadmap_types.h" int buildmap_shape_add (int line, int sequence, int longitude, int latitude); ! #endif // INCLUDED__BUILDMAP_SHAPE__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:36:52
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv566 Modified Files: buildmap_range.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_range.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_range.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_range.h 25 Oct 2004 01:37:13 -0000 1.2 --- buildmap_range.h 16 Jan 2006 20:36:43 -0000 1.3 *************** *** 22,32 **** */ ! #ifndef _BUILDMAP_RANGE__H_ ! #define _BUILDMAP_RANGE__H_ #include "roadmap_types.h" - void buildmap_range_initialize (void); - void buildmap_range_merge (int frleft, int toleft, int frright, int toright, --- 22,30 ---- */ ! #ifndef INCLUDED__BUILDMAP_RANGE__H ! #define INCLUDED__BUILDMAP_RANGE__H #include "roadmap_types.h" void buildmap_range_merge (int frleft, int toleft, int frright, int toright, *************** *** 39,47 **** void buildmap_range_add_place (RoadMapString place, RoadMapString city); ! void buildmap_range_sort (void); ! ! void buildmap_range_save (void); ! void buildmap_range_summary (void); ! void buildmap_range_reset (void); ! ! #endif // _BUILDMAP_RANGE__H_ --- 37,39 ---- void buildmap_range_add_place (RoadMapString place, RoadMapString city); ! #endif // INCLUDED__BUILDMAP_RANGE__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:36:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv367 Modified Files: buildmap_point.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_point.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_point.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_point.h 21 Feb 2003 20:07:15 -0000 1.1.1.1 --- buildmap_point.h 16 Jan 2006 20:35:59 -0000 1.2 *************** *** 22,35 **** */ ! #ifndef _BUILDMAP_POINT__H_ ! #define _BUILDMAP_POINT__H_ - void buildmap_point_initialize (void); int buildmap_point_add (int longitude, int latitude); - void buildmap_point_sort (void); int buildmap_point_get_square (int pointid); int buildmap_point_get_longitude (int pointid); int buildmap_point_get_latitude (int pointid); int buildmap_point_get_sorted (int pointid); int buildmap_point_get_longitude_sorted (int point); --- 22,34 ---- */ ! #ifndef INCLUDED__BUILDMAP_POINT__H ! #define INCLUDED__BUILDMAP_POINT__H int buildmap_point_add (int longitude, int latitude); int buildmap_point_get_square (int pointid); int buildmap_point_get_longitude (int pointid); int buildmap_point_get_latitude (int pointid); + int buildmap_point_get_sorted (int pointid); int buildmap_point_get_longitude_sorted (int point); *************** *** 37,44 **** int buildmap_point_get_square_sorted (int point); ! void buildmap_point_save (void); ! void buildmap_point_summary (void); ! void buildmap_point_reset (void); ! #endif // _BUILDMAP_POINT__H_ --- 36,41 ---- int buildmap_point_get_square_sorted (int point); ! void buildmap_point_sort (void); ! #endif // INCLUDED__BUILDMAP_POINT__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:36:31
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv448 Modified Files: buildmap_polygon.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_polygon.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_polygon.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_polygon.h 21 Feb 2003 20:07:17 -0000 1.1.1.1 --- buildmap_polygon.h 16 Jan 2006 20:36:23 -0000 1.2 *************** *** 22,32 **** */ ! #ifndef _ROADMAP_POLYGON__H_ ! #define _ROADMAP_POLYGON__H_ #define POLYGON_SIDE_LEFT 0 #define POLYGON_SIDE_RIGHT 1 - void buildmap_polygon_initialize (void); int buildmap_polygon_add (int landid, RoadMapString cenid, int polyid); int buildmap_polygon_add_landmark --- 22,31 ---- */ ! #ifndef INCLUDED__ROADMAP_POLYGON__H ! #define INCLUDED__ROADMAP_POLYGON__H #define POLYGON_SIDE_LEFT 0 #define POLYGON_SIDE_RIGHT 1 int buildmap_polygon_add (int landid, RoadMapString cenid, int polyid); int buildmap_polygon_add_landmark *************** *** 34,43 **** int buildmap_polygon_add_line (RoadMapString cenid, int polyid, int tlid, int side); int buildmap_polygon_use_line (int tlid); - void buildmap_polygon_sort (void); - void buildmap_polygon_save (void); - void buildmap_polygon_summary (void); - void buildmap_polygon_reset (void); ! #endif // _ROADMAP_POLYGON__H_ --- 33,39 ---- int buildmap_polygon_add_line (RoadMapString cenid, int polyid, int tlid, int side); + int buildmap_polygon_use_line (int tlid); ! #endif // INCLUDED__ROADMAP_POLYGON__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:35:46
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv302 Modified Files: buildmap_place.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_place.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_place.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_place.h 27 Nov 2004 19:10:35 -0000 1.2 --- buildmap_place.h 16 Jan 2006 20:35:34 -0000 1.3 *************** *** 22,36 **** */ ! #ifndef _BUILDMAP_PLACE__H_ ! #define _BUILDMAP_PLACE__H_ #define BUILDMAP_MAX_PLACE_CFCC 10 - void buildmap_place_initialize (void); int buildmap_place_add (int name, int cfcc, int point); int buildmap_place_get_sorted (int place); int buildmap_place_get_name_sorted (int place); - /* static BuildMapPlace *buildmap_place_get_record (int place); */ - /* static BuildMapPlace *buildmap_place_get_record_sorted (int place); */ int buildmap_place_find_sorted (int name); void buildmap_place_get_position --- 22,34 ---- */ ! #ifndef INCLUDED__BUILDMAP_PLACE__H ! #define INCLUDED__BUILDMAP_PLACE__H #define BUILDMAP_MAX_PLACE_CFCC 10 int buildmap_place_add (int name, int cfcc, int point); + int buildmap_place_get_sorted (int place); int buildmap_place_get_name_sorted (int place); int buildmap_place_find_sorted (int name); void buildmap_place_get_position *************** *** 40,49 **** (int place, int *longitude, int *latitude); int buildmap_place_get_square_sorted (int place); - /* int buildmap_place_compare (const void *r1, const void *r2); */ - void buildmap_place_sort (void); - void buildmap_place_save (void); - void buildmap_place_summary (void); - void buildmap_place_reset (void); ! #endif /* _BUILDMAP_PLACE__H_ */ --- 38,42 ---- (int place, int *longitude, int *latitude); int buildmap_place_get_square_sorted (int place); ! #endif /* INCLUDED__BUILDMAP_PLACE__H */ |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:35:15
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32676 Modified Files: buildmap_metadata.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_metadata.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_metadata.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_metadata.h 2 Jan 2006 09:08:49 -0000 1.2 --- buildmap_metadata.h 16 Jan 2006 20:35:04 -0000 1.3 *************** *** 25,30 **** #define INCLUDED__BUILDMAP_METADATA__H - void buildmap_metadata_initialize (void); - void buildmap_metadata_add_attribute (const char *category, const char *name, --- 25,28 ---- *************** *** 35,43 **** const char *value); - void buildmap_metadata_sort (void); - void buildmap_metadata_save (void); - void buildmap_metadata_summary (void); - void buildmap_metadata_reset (void); - #endif // INCLUDED__BUILDMAP_METADATA__H --- 33,36 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:34:53
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32593 Modified Files: buildmap_line.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_line.h 21 Feb 2003 20:07:14 -0000 1.1.1.1 --- buildmap_line.h 16 Jan 2006 20:34:45 -0000 1.2 *************** *** 22,29 **** */ ! #ifndef _BUILDMAP_LINE__H_ ! #define _BUILDMAP_LINE__H_ - void buildmap_line_initialize (void); int buildmap_line_add (int tlid, int cfcc, int from, int to); --- 22,28 ---- */ ! #ifndef INCLUDED__BUILDMAP_LINE__H ! #define INCLUDED__BUILDMAP_LINE__H int buildmap_line_add (int tlid, int cfcc, int from, int to); *************** *** 36,45 **** void buildmap_line_get_position_sorted (int line, int *longitude, int *latitude); - void buildmap_line_sort (void); ! void buildmap_line_save (void); ! void buildmap_line_summary (void); ! void buildmap_line_reset (void); ! #endif // _BUILDMAP_LINE__H_ --- 35,41 ---- void buildmap_line_get_position_sorted (int line, int *longitude, int *latitude); ! void buildmap_line_sort (void); ! #endif // INCLUDED__BUILDMAP_LINE__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:34:26
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32505 Modified Files: buildmap_index.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_index.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_index.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_index.h 2 Jan 2006 09:13:45 -0000 1.1 --- buildmap_index.h 16 Jan 2006 20:34:19 -0000 1.2 *************** *** 42,49 **** void buildmap_index_add_postal_code (unsigned int code); - void buildmap_index_sort (void); - void buildmap_index_save (void); - void buildmap_index_summary (void); - #endif // INCLUDED__BUILDMAP_INDEX__H --- 42,45 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:33:55
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32357 Modified Files: buildmap_city.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_city.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_city.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_city.h 21 Feb 2003 20:07:10 -0000 1.1.1.1 --- buildmap_city.h 16 Jan 2006 20:33:47 -0000 1.2 *************** *** 22,38 **** */ ! #ifndef _BUILDMAP_CITY__H_ ! #define _BUILDMAP_CITY__H_ #include "roadmap_types.h" - void buildmap_city_initialize (void); void buildmap_city_add (int fips, int year, RoadMapString name); RoadMapString buildmap_city_get_name (int fips); ! void buildmap_city_save (void); ! void buildmap_city_summary (void); ! void buildmap_city_reset (void); ! ! #endif /* _BUILDMAP_CITY__H_ */ --- 22,33 ---- */ ! #ifndef INCLUDED__BUILDMAP_CITY__H ! #define INCLUDED__BUILDMAP_CITY__H #include "roadmap_types.h" void buildmap_city_add (int fips, int year, RoadMapString name); RoadMapString buildmap_city_get_name (int fips); ! #endif /* INCLUDED__BUILDMAP_CITY__H */ |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:33:29
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32259 Modified Files: buildmap_area.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_area.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_area.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildmap_area.h 21 Feb 2003 20:07:10 -0000 1.1.1.1 --- buildmap_area.h 16 Jan 2006 20:33:21 -0000 1.2 *************** *** 22,31 **** */ ! #ifndef _BUILDMAP_AREA__H_ ! #define _BUILDMAP_AREA__H_ #include "roadmap_types.h" - void buildmap_area_initialize (void); int buildmap_area_add (char cfcc, --- 22,30 ---- */ ! #ifndef INCLUDED__BUILDMAP_AREA__H ! #define INCLUDED__BUILDMAP_AREA__H #include "roadmap_types.h" int buildmap_area_add (char cfcc, *************** *** 35,42 **** RoadMapString fedirs, int tlid); - void buildmap_area_sort (void); - void buildmap_area_save (void); - void buildmap_area_summary (void); ! #endif // _BUILDMAP_AREA__H_ --- 34,38 ---- RoadMapString fedirs, int tlid); ! #endif // INCLUDED__BUILDMAP_AREA__H |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:26:51
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30359 Modified Files: roadmap_index.c Log Message: roadmap_hash_free & roadmap_hash_reset were incompatible (list not updated) Index: roadmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_index.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_index.c 9 Jan 2006 07:36:26 -0000 1.3 --- roadmap_index.c 16 Jan 2006 20:26:43 -0000 1.4 *************** *** 189,193 **** if (index_context->territory_is_covered != NULL) { ! roadmap_hash_free (index_context->hash); free (index_context->territory_is_covered); } --- 189,193 ---- if (index_context->territory_is_covered != NULL) { ! roadmap_hash_delete (index_context->hash); free (index_context->territory_is_covered); } |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:26:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30275 Modified Files: roadmap_hash.c Log Message: roadmap_hash_free & roadmap_hash_reset were incompatible (list not updated) Index: roadmap_hash.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_hash.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_hash.c 4 Aug 2003 08:23:23 -0000 1.4 --- roadmap_hash.c 16 Jan 2006 20:26:14 -0000 1.5 *************** *** 49,52 **** --- 49,62 ---- + static void roadmap_hash_free (RoadMapHash *hash) { + + if (hash->values != NULL) { + free (hash->values); + } + free (hash->next); + free (hash); + } + + RoadMapHash *roadmap_hash_new (char *name, int size) { *************** *** 141,154 **** - void roadmap_hash_free (RoadMapHash *hash) { - - if (hash->values != NULL) { - free (hash->values); - } - free (hash->next); - free (hash); - } - - void roadmap_hash_set_value (RoadMapHash *hash, int index, void *value) { --- 151,154 ---- *************** *** 214,217 **** --- 214,244 ---- + void roadmap_hash_delete (RoadMapHash *hash) { + + RoadMapHash *cursor; + + if (hash == NULL) return; + + if (HashLast == hash) { + + /* This was the last hash created. Remove it from the list. */ + HashLast = cursor->next_hash; + + } else { + + for (cursor = HashLast; cursor != NULL; cursor = cursor->next_hash) { + + if (cursor->next_hash == hash) { + /* This is our hash table: removes it from the list. */ + cursor->next_hash = hash->next_hash; + break; + } + } + } + + roadmap_hash_free (hash); + } + + void roadmap_hash_reset (void) { *************** *** 223,231 **** next = hash->next_hash; ! if (hash->values != NULL) { ! free (hash->values); ! } ! free (hash->next); ! free (hash); } HashLast = NULL; --- 250,254 ---- next = hash->next_hash; ! roadmap_hash_free (hash); } HashLast = NULL; |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:22:07
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29444 Modified Files: roadmap_hash.h Log Message: roadmap_hash_free & roadmap_hash_reset were incompatible (list not updated) Index: roadmap_hash.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_hash.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_hash.h 4 Aug 2003 08:23:30 -0000 1.3 --- roadmap_hash.h 16 Jan 2006 20:21:58 -0000 1.4 *************** *** 57,61 **** void roadmap_hash_resize (RoadMapHash *hash, int size); ! void roadmap_hash_free (RoadMapHash *hash); void roadmap_hash_set_value (RoadMapHash *hash, int index, void *value); --- 57,61 ---- void roadmap_hash_resize (RoadMapHash *hash, int size); ! void roadmap_hash_delete (RoadMapHash *hash); void roadmap_hash_set_value (RoadMapHash *hash, int index, void *value); |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:21:07
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29186 Modified Files: buildmap_dbwrite.c Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap_dbwrite.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_dbwrite.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** buildmap_dbwrite.c 2 Jan 2006 08:53:29 -0000 1.4 --- buildmap_dbwrite.c 16 Jan 2006 20:20:59 -0000 1.5 *************** *** 58,61 **** --- 58,67 ---- + #define BUILDMAP_MAX_MODULE 256 + + static const buildmap_db_module *BuildmapModuleRegistration[BUILDMAP_MAX_MODULE]; + static int BuildmapModuleCount = 0; + + static void buildmap_db_repair_tree (buildmap_db *section) { *************** *** 347,348 **** --- 353,424 ---- } + + /* This section brings support for generic operations on all + * modules. + */ + + void buildmap_db_register (const buildmap_db_module *module) { + + int i; + + /* First check if that module was not already registered. */ + + for (i = BuildmapModuleCount - 1; i >= 0; --i) { + if (BuildmapModuleRegistration[i] == module) return; + } + + if (BuildmapModuleCount >= BUILDMAP_MAX_MODULE) { + buildmap_fatal (0, "too many modules"); + } + + BuildmapModuleRegistration[BuildmapModuleCount++] = module; + } + + + void buildmap_db_sort (void) { + + int i; + + for (i = 0; i < BuildmapModuleCount; ++i) { + if (BuildmapModuleRegistration[i]->sort != NULL) { + BuildmapModuleRegistration[i]->sort (); + } + } + } + + + void buildmap_db_save (void) { + + int i; + + for (i = 0; i < BuildmapModuleCount; ++i) { + if (BuildmapModuleRegistration[i]->save != NULL) { + BuildmapModuleRegistration[i]->save (); + } + } + } + + + void buildmap_db_summary (void) { + + int i; + + for (i = 0; i < BuildmapModuleCount; ++i) { + if (BuildmapModuleRegistration[i]->summary != NULL) { + BuildmapModuleRegistration[i]->summary (); + } + } + } + + + void buildmap_db_reset (void) { + + int i; + + for (i = 0; i < BuildmapModuleCount; ++i) { + if (BuildmapModuleRegistration[i]->reset != NULL) { + BuildmapModuleRegistration[i]->reset (); + } + } + } + |
From: Pascal F M. <pas...@us...> - 2006-01-16 20:20:37
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29021 Modified Files: buildmap.h Log Message: Make buildmap more modular using self registration of the "table" builders Index: buildmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buildmap.h 3 Jan 2006 04:05:15 -0000 1.3 --- buildmap.h 16 Jan 2006 20:20:29 -0000 1.4 *************** *** 43,49 **** --- 43,51 ---- int buildmap_get_error_total (void); + typedef struct dictionary_volume *BuildMapDictionary; BuildMapDictionary buildmap_dictionary_open (char *name); + RoadMapString buildmap_dictionary_add (BuildMapDictionary dictionary, const char *string, int length); *************** *** 54,61 **** (BuildMapDictionary dictionary, RoadMapString index); - void buildmap_dictionary_summary (void); - void buildmap_dictionary_save (void); - void buildmap_dictionary_reset (void); - struct buildmap_db_section { --- 56,59 ---- *************** *** 72,77 **** --- 70,90 ---- + typedef void (*buildmap_db_action) (void); + + typedef struct { + + const char *name; + buildmap_db_action sort; + buildmap_db_action save; + buildmap_db_action summary; + buildmap_db_action reset; + + } buildmap_db_module; + + int buildmap_db_open (const char *path, const char *name); + void buildmap_db_register (const buildmap_db_module *module); + buildmap_db *buildmap_db_add_section (buildmap_db *parent, const char *name); int buildmap_db_add_data (buildmap_db *section, int count, int size); *************** *** 83,86 **** --- 96,105 ---- int size); + /* The functions that call the registered actions: */ + void buildmap_db_sort (void); + void buildmap_db_save (void); + void buildmap_db_summary (void); + void buildmap_db_reset (void); + void buildmap_db_close (void); |
From: Pascal F M. <pas...@us...> - 2006-01-15 03:08:29
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4887 Added Files: rdmxchange_range.c Log Message: Complete export code for rdmxchange --- NEW FILE: rdmxchange_range.c --- /* rdmxchange_range.c - Export street address range tables. * * LICENSE: * * Copyright 2005 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_db_range.h" #include "roadmap.h" #include "roadmap_dbread.h" #include "rdmxchange.h" static char *RoadMapRangeType = "RoadMapRangeContext"; typedef struct { char *type; RoadMapRangeByStreet *ByStreet; int ByStreetCount; RoadMapRangeByCity *ByCity; int ByCityCount; RoadMapRangePlace *Place; int PlaceCount; RoadMapRangeByZip *ByZip; int ByZipCount; RoadMapRangeBySquare *BySquare; int BySquareCount; RoadMapRange *Address; int AddressCount; RoadMapRangeNoAddress *NoAddress; int NoAddressCount; } RoadMapRangeContext; static RoadMapRangeContext *RoadMapRangeActive = NULL; static void rdmxchange_range_register_export (void); static void *rdmxchange_range_map (roadmap_db *root) { RoadMapRangeContext *context; roadmap_db *table; context = malloc (sizeof(RoadMapRangeContext)); roadmap_check_allocated(context); context->type = RoadMapRangeType; table = roadmap_db_get_subsection (root, "bystreet"); context->ByStreet = (RoadMapRangeByStreet *) roadmap_db_get_data (table); context->ByStreetCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->ByStreetCount * sizeof(RoadMapRangeByStreet)) { roadmap_log (ROADMAP_FATAL, "invalid range/bystreet structure"); } table = roadmap_db_get_subsection (root, "bycity"); context->ByCity = (RoadMapRangeByCity *) roadmap_db_get_data (table); context->ByCityCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->ByCityCount * sizeof(RoadMapRangeByCity)) { roadmap_log (ROADMAP_FATAL, "invalid range/bycity structure"); } table = roadmap_db_get_subsection (root, "place"); context->Place = (RoadMapRangePlace *) roadmap_db_get_data (table); context->PlaceCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->PlaceCount * sizeof(RoadMapRangePlace)) { roadmap_log (ROADMAP_FATAL, "invalid range/place structure"); } table = roadmap_db_get_subsection (root, "byzip"); context->ByZip = (RoadMapRangeByZip *) roadmap_db_get_data (table); context->ByZipCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->ByZipCount * sizeof(RoadMapRangeByZip)) { roadmap_log (ROADMAP_FATAL, "invalid range/byzip structure"); } table = roadmap_db_get_subsection (root, "bysquare"); context->BySquare = (RoadMapRangeBySquare *) roadmap_db_get_data (table); context->BySquareCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->BySquareCount * sizeof(RoadMapRangeBySquare)) { roadmap_log (ROADMAP_FATAL, "invalid range/bysquare structure"); } table = roadmap_db_get_subsection (root, "addr"); context->Address = (RoadMapRange *) roadmap_db_get_data (table); context->AddressCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->AddressCount * sizeof(RoadMapRange)) { roadmap_log (ROADMAP_FATAL, "invalid range/addr structure"); } table = roadmap_db_get_subsection (root, "noaddr"); context->NoAddress = (RoadMapRangeNoAddress *) roadmap_db_get_data (table); context->NoAddressCount = roadmap_db_get_count (table); if (roadmap_db_get_size (table) != context->NoAddressCount * sizeof(RoadMapRangeNoAddress)) { roadmap_log (ROADMAP_FATAL, "invalid range/noaddr structure"); } rdmxchange_range_register_export(); return context; } static void rdmxchange_range_activate (void *context) { RoadMapRangeContext *this = (RoadMapRangeContext *) context; if (this != NULL) { if (this->type != RoadMapRangeType) { roadmap_log (ROADMAP_FATAL, "cannot activate (bad context type)"); } } RoadMapRangeActive = this; } static void rdmxchange_range_unmap (void *context) { RoadMapRangeContext *this = (RoadMapRangeContext *) context; if (this->type != RoadMapRangeType) { roadmap_log (ROADMAP_FATAL, "cannot unmap (bad context type)"); } if (RoadMapRangeActive == this) { RoadMapRangeActive = NULL; } free (this); } roadmap_db_handler RoadMapRangeExport = { "range", rdmxchange_range_map, rdmxchange_range_activate, rdmxchange_range_unmap }; static void rdmxchange_range_export_head (FILE *file) { fprintf (file, "table range/bystreet %d\n", RoadMapRangeActive->ByStreetCount); fprintf (file, "table range/bycity %d\n", RoadMapRangeActive->ByCityCount); fprintf (file, "table range/place %d\n", RoadMapRangeActive->PlaceCount); fprintf (file, "table range/byzip %d\n", RoadMapRangeActive->ByZipCount); fprintf (file, "table range/bysquare %d\n", RoadMapRangeActive->BySquareCount); fprintf (file, "table range/addr %d\n", RoadMapRangeActive->AddressCount); fprintf (file, "table range/noaddr %d\n", RoadMapRangeActive->NoAddressCount); } static void rdmxchange_range_export_data (FILE *file) { int i; int j; RoadMapRangeByStreet *bystreet; RoadMapRangeByCity *bycity; RoadMapRangePlace *place; RoadMapRangeByZip *byzip; RoadMapRangeBySquare *bysquare; RoadMapRange *address; RoadMapRangeNoAddress *noaddress; fprintf (file, "table range/bystreet\n" "first_range," "first_city," "first_zip," "count\n"); bystreet = RoadMapRangeActive->ByStreet; for (i = 0; i < RoadMapRangeActive->ByStreetCount; ++i, ++bystreet) { fprintf (file, "%.0d,%.0d,%.0d,%.0d\n", bystreet->first_range, bystreet->first_city, bystreet->first_zip, bystreet->count_range); } fprintf (file, "\n"); fprintf (file, "table range/bycity\n" "city," "count\n"); bycity = RoadMapRangeActive->ByCity; for (i = 0; i < RoadMapRangeActive->ByCityCount; ++i, ++bycity) { fprintf (file, "%.0d,%.0d\n", bycity->city, bycity->count); } fprintf (file, "\n"); fprintf (file, "table range/place\n" "place," "city\n"); place = RoadMapRangeActive->Place; for (i = 0; i < RoadMapRangeActive->PlaceCount; ++i, ++place) { fprintf (file, "%.0d,%.0d\n", place->place, place->city); } fprintf (file, "\n"); fprintf (file, "table range/byzip\n" "zip," "count\n"); byzip = RoadMapRangeActive->ByZip; for (i = 0; i < RoadMapRangeActive->ByZipCount; ++i, ++byzip) { fprintf (file, "%.0d,%.0d\n", byzip->zip, byzip->count); } fprintf (file, "\n"); fprintf (file, "table range/bysquare\n" "excluded[%d]," "included[%d]," "start," "count\n", ROADMAP_RANGE_HOLES, ROADMAP_RANGE_HOLES); bysquare = RoadMapRangeActive->BySquare; for (i = 0; i < RoadMapRangeActive->BySquareCount; ++i, ++bysquare) { for (j = 0; j < ROADMAP_RANGE_HOLES; ++j) { fprintf (file, "%.0d,", bysquare->hole[j].excluded); } for (j = 0; j < ROADMAP_RANGE_HOLES; ++j) { fprintf (file, "%.0d,", bysquare->hole[j].included); } fprintf (file, "%.0d,%.0d\n", bysquare->noaddr_start, bysquare->noaddr_count); } fprintf (file, "\n"); fprintf (file, "table range/addr\n" "line," "fradd," "toadd\n"); address = RoadMapRangeActive->Address; for (i = 0; i < RoadMapRangeActive->AddressCount; ++i, ++address) { fprintf (file, "%.0d,%.0d,%.0d\n", address->line, address->fradd, address->toadd); } fprintf (file, "\n"); fprintf (file, "table range/noaddr\n" "line," "street\n"); noaddress = RoadMapRangeActive->NoAddress; for (i = 0; i < RoadMapRangeActive->NoAddressCount; ++i, ++noaddress) { fprintf (file, "%.0d,%.0d\n", noaddress->line, noaddress->street); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeRangeExport = { "street", rdmxchange_range_export_head, rdmxchange_range_export_data }; static void rdmxchange_range_register_export (void) { rdmxchange_main_register_export (&RdmXchangeRangeExport); } |