|
From: Danny B. <dan...@us...> - 2009-05-12 13:55:38
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31982 Modified Files: buildmap.h buildmap_city.c buildmap_dbwrite.c buildmap_line.c buildmap_place.c buildmap_point.c buildmap_polygon.c buildmap_shape.c buildmap_street.c buildmap_turn_restrictions.c Log Message: This might fix the memory issue that appeared when building big maps. Also add documentation. Index: buildmap_city.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_city.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** buildmap_city.c 11 Mar 2007 02:11:18 -0000 1.3 --- buildmap_city.c 12 May 2009 13:53:32 -0000 1.4 *************** *** 1,7 **** ! /* buildmap_city.c - Build a city table & index for BuildMap. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 20,35 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ! * SYNOPSYS: ! * ! * void buildmap_city_add (int fips, int year, RoadMapString name); ! * ! * RoadMapString buildmap_city_get_name (int fips); ! * ! * These functions are used to build a table of cities from ! * the Tiger maps. The objective is double: (1) reduce the size of ! * the Tiger data by sharing all duplicated information and ! * (2) produce the index data to serve as the basis for a fast ! * search mechanism for streets in roadmap. * * There is no city table for RoadMap, because the only attribute --- 20,30 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Build a city table & index for BuildMap. * ! * These functions are used to build a table of cities. * * There is no city table for RoadMap, because the only attribute *************** *** 66,70 **** static void buildmap_city_register (void); ! static void buildmap_city_initialize (void) { --- 61,67 ---- static void buildmap_city_register (void); ! /** ! * @brief initialize the city module ! */ static void buildmap_city_initialize (void) { *************** *** 76,80 **** } ! void buildmap_city_add (int fips, int year, RoadMapString name) { --- 73,82 ---- } ! /** ! * @brief add a city ! * @param fips a region code (county or other country subdivision) ! * @param year (not sure why this is relevant) ! * @param name the city name ! */ void buildmap_city_add (int fips, int year, RoadMapString name) { *************** *** 116,119 **** --- 118,127 ---- offset = CityCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned city table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (City[block] == NULL) { *************** *** 138,142 **** } ! RoadMapString buildmap_city_get_name (int fips) { --- 146,154 ---- } ! /** ! * @brief query the name of a city by fips ! * @param fips identifies the city ! * @return internal represenation of city name ! */ RoadMapString buildmap_city_get_name (int fips) { *************** *** 160,164 **** } ! static void buildmap_city_summary (void) { --- 172,178 ---- } ! /** ! * @brief print buildmap summary for this module ! */ static void buildmap_city_summary (void) { *************** *** 167,171 **** } ! static void buildmap_city_reset (void) { --- 181,187 ---- } ! /** ! * @brief clear city module database ! */ static void buildmap_city_reset (void) { *************** *** 185,189 **** } ! static buildmap_db_module BuildMapCityModule = { "city", --- 201,207 ---- } ! /** ! * @brief identify the city module ! */ static buildmap_db_module BuildMapCityModule = { "city", *************** *** 194,200 **** }; ! static void buildmap_city_register (void) { buildmap_db_register (&BuildMapCityModule); } - --- 212,219 ---- }; ! /** ! * @brief register the city module with the buildmap application ! */ static void buildmap_city_register (void) { buildmap_db_register (&BuildMapCityModule); } Index: buildmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap.h 3 Dec 2007 18:29:04 -0000 1.7 --- buildmap.h 12 May 2009 13:53:32 -0000 1.8 *************** *** 1,7 **** ! /* buildmap.h - General definition for the map builder tool. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 22,25 **** --- 22,29 ---- */ + /* + * buildmap.h - General definition for the map builder tool. + */ + #ifndef INCLUDED__ROADMAP_BUILDMAP__H #define INCLUDED__ROADMAP_BUILDMAP__H *************** *** 28,32 **** #include "roadmap_db.h" ! #define BUILDMAP_BLOCK 2048 /* memory allocation block. */ --- 32,36 ---- #include "roadmap_db.h" ! #define BUILDMAP_BLOCK 4096 /* memory allocation block. */ Index: buildmap_turn_restrictions.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_turn_restrictions.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_turn_restrictions.c 15 Mar 2009 08:11:47 -0000 1.1 --- buildmap_turn_restrictions.c 12 May 2009 13:53:32 -0000 1.2 *************** *** 122,125 **** --- 122,131 ---- if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned turns table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + + if (block >= BUILDMAP_BLOCK) { buildmap_fatal (0, "too many shape records"); } *************** *** 183,187 **** } ! static int buildmap_turns_compare (const void *r1, const void *r2) { --- 189,198 ---- } ! /** ! * @brief support function for sorting the turns ! * @param r1 ! * @param r2 ! * @return ! */ static int buildmap_turns_compare (const void *r1, const void *r2) { *************** *** 207,210 **** --- 218,224 ---- + /** + * @brief Sort turns by node id, then by line ids. + */ void buildmap_turn_restrictions_sort (void) { *************** *** 227,231 **** } ! void buildmap_turn_restrictions_save (void) { --- 241,247 ---- } ! /** ! * @brief Save the turn restrictions database ! */ void buildmap_turn_restrictions_save (void) { Index: buildmap_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_shape.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** buildmap_shape.c 29 Mar 2009 11:53:56 -0000 1.13 --- buildmap_shape.c 12 May 2009 13:53:32 -0000 1.14 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 149,152 **** --- 150,159 ---- if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned shape table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + + if (block >= BUILDMAP_BLOCK) { buildmap_fatal (0, "too many shape records"); } Index: buildmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_line.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** buildmap_line.c 30 Mar 2009 18:40:24 -0000 1.25 --- buildmap_line.c 12 May 2009 13:53:32 -0000 1.26 *************** *** 101,105 **** ! /* FIXME. this is called for every line, but it misses all of the * shape points for the line, so the bounding box is a poor * approximation, at best. polygons have the same problem. --- 101,111 ---- ! /** ! * @brief ! * @param line ! * @param longitude ! * @param latitude ! * ! * FIXME. this is called for every line, but it misses all of the * shape points for the line, so the bounding box is a poor * approximation, at best. polygons have the same problem. *************** *** 208,211 **** --- 214,223 ---- offset = LineCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned line table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (Line[block] == NULL) { *************** *** 226,229 **** --- 238,242 ---- } if (layer <= 0) { + abort(); buildmap_fatal (0, "invalid layer %d in line #%d", layer, tlid); } Index: buildmap_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_point.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildmap_point.c 4 Aug 2008 17:44:07 -0000 1.10 --- buildmap_point.c 12 May 2009 13:53:32 -0000 1.11 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 24,45 **** * @file * @brief Build a table of all points referenced in lines. - * - * SYNOPSYS: - * - * 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); - * int buildmap_point_get_latitude_sorted (int point); - * int buildmap_point_get_square_sorted (int pointid); - * - * These functions are used to build a table of lines from - * the Tiger maps. The objective is double: (1) reduce the size of - * the Tiger data by sharing all duplicated information and - * (2) produce the index data to serve as the basis for a fast - * search mechanism for streets in roadmap. */ --- 25,28 ---- *************** *** 56,60 **** #include "buildmap_square.h" ! typedef struct { int longitude; --- 39,45 ---- #include "buildmap_square.h" ! /** ! * @brief internal structure of the point database while building a map ! */ typedef struct { int longitude; *************** *** 75,78 **** --- 60,66 ---- static void buildmap_point_register (void); + /** + * @brief initialize the point module + */ static void buildmap_point_initialize (void) { *************** *** 128,131 **** --- 116,125 ---- offset = PointCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned point table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (Point[block] == NULL) { *************** *** 159,163 **** } ! static BuildMapPoint *buildmap_point_get (int pointid) { --- 153,161 ---- } ! /** ! * @brief get the id of a point ! * @param point the point to query ! * @return id ! */ static BuildMapPoint *buildmap_point_get (int pointid) { *************** *** 173,177 **** } ! int buildmap_point_get_square (int pointid) { --- 171,179 ---- } ! /** ! * @brief get the square of a point ! * @param point the point to query ! * @return square ! */ int buildmap_point_get_square (int pointid) { *************** *** 179,183 **** } ! int buildmap_point_get_longitude (int pointid) { --- 181,189 ---- } ! /** ! * @brief get the longitude of a point ! * @param point the point to query ! * @return longitude ! */ int buildmap_point_get_longitude (int pointid) { *************** *** 185,189 **** } ! int buildmap_point_get_latitude (int pointid) { --- 191,199 ---- } ! /** ! * @brief get the latitude of a point ! * @param point the point to query ! * @return latitude ! */ int buildmap_point_get_latitude (int pointid) { *************** *** 191,195 **** } ! int buildmap_point_get_sorted (int pointid) { --- 201,209 ---- } ! /** ! * @brief get the id of a point ! * @param point the point to query ! * @return id ! */ int buildmap_point_get_sorted (int pointid) { *************** *** 201,205 **** } ! int buildmap_point_get_square_sorted (int point) { --- 215,223 ---- } ! /** ! * @brief get the square of a sorted point ! * @param point the point to query ! * @return square ! */ int buildmap_point_get_square_sorted (int point) { *************** *** 214,218 **** } ! int buildmap_point_get_longitude_sorted (int point) { --- 232,240 ---- } ! /** ! * @brief get the longitude of a sorted point ! * @param point the point to query ! * @return longitude ! */ int buildmap_point_get_longitude_sorted (int point) { *************** *** 227,231 **** } ! int buildmap_point_get_latitude_sorted (int point) { --- 249,257 ---- } ! /** ! * @brief get the latitude of a sorted point ! * @param point the point to query ! * @return latitude ! */ int buildmap_point_get_latitude_sorted (int point) { *************** *** 240,244 **** } ! static int buildmap_point_compare (const void *r1, const void *r2) { --- 266,275 ---- } ! /** ! * @brief compare two points ! * @param r1 the first point ! * @param r2 the second point ! * @return 0 if equal ! */ static int buildmap_point_compare (const void *r1, const void *r2) { *************** *** 271,274 **** --- 302,308 ---- } + /** + * @brief sort the points + */ void buildmap_point_sort (void) { *************** *** 319,323 **** } ! static void buildmap_point_save (void) { --- 353,359 ---- } ! /** ! * @brief save points into the database file ! */ static void buildmap_point_save (void) { *************** *** 387,391 **** } ! static void buildmap_point_summary (void) { --- 423,429 ---- } ! /** ! * @brief print a summary for this module ! */ static void buildmap_point_summary (void) { *************** *** 394,398 **** } ! static void buildmap_point_reset (void) { --- 432,438 ---- } ! /** ! * @brief remove all points ! */ static void buildmap_point_reset (void) { *************** *** 418,422 **** } ! static buildmap_db_module BuildMapPointModule = { "point", --- 458,464 ---- } ! /** ! * @brief structure to register the point module ! */ static buildmap_db_module BuildMapPointModule = { "point", *************** *** 427,433 **** }; ! static void buildmap_point_register (void) { buildmap_db_register (&BuildMapPointModule); } - --- 469,476 ---- }; ! /** ! * @brief register the point module with the buildmap application ! */ static void buildmap_point_register (void) { buildmap_db_register (&BuildMapPointModule); } Index: buildmap_place.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_place.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildmap_place.c 27 Nov 2007 13:44:06 -0000 1.6 --- buildmap_place.c 12 May 2009 13:53:32 -0000 1.7 *************** *** 1,7 **** ! /* buildmap_place.c - Build a place table & index for RoadMap. ! * * LICENSE: * * Copyright 2004 Stephen Woodbridge <wo...@sw...> * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2004 Stephen Woodbridge <wo...@sw...> + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 20,46 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * int buildmap_place_add (int name, int layer, int point); ! * ! * int buildmap_place_get_sorted (int place); ! * int buildmap_place_get_name_sorted (int place); ! * BuildMapPlace *buildmap_place_get_record (int place); ! * BuildMapPlace *buildmap_place_get_record_sorted (int place); ! * void buildmap_place_find_sorted (int name); ! * void buildmap_place_get_position ! * (int place, int *longitude, int *latitude); ! * int buildmap_place_get_point_sorted (int place); ! * void buildmap_place_get_position_sorted ! * (int place, int *longitude, int *latitude); ! * void buildmap_place_get_square_sorted (int place); ! * int buildmap_place_compare (const void *r1, const void *r2); * * These functions are used to build a table of places from ! * the various data sources. The objective is double: (1) reduce ! * the size of the data by sharing all duplicated information and ! * (2) produce the index data to serve as the basis for a fast ! * search mechanism for places in roadmap. */ --- 20,31 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief Build a place table & index for RoadMap. * * These functions are used to build a table of places from ! * the various data sources. */ *************** *** 79,83 **** static void buildmap_place_register (void); ! static void buildmap_place_initialize (void) { --- 64,70 ---- static void buildmap_place_register (void); ! /** ! * @brief ! */ static void buildmap_place_initialize (void) { *************** *** 94,98 **** } ! int buildmap_place_add (int name, int layer, int point) { --- 81,91 ---- } ! /** ! * @brief ! * @param name ! * @param layer ! * @param point ! * @return ! */ int buildmap_place_add (int name, int layer, int point) { *************** *** 108,111 **** --- 101,110 ---- offset = PlaceCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned place table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (Place[block] == NULL) { *************** *** 134,138 **** } ! int buildmap_place_find_sorted (int name) { --- 133,141 ---- } ! /** ! * @brief ! * @param name ! * @return ! */ int buildmap_place_find_sorted (int name) { *************** *** 158,162 **** } ! static BuildMapPlace *buildmap_place_get_record (int place) { --- 161,169 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ static BuildMapPlace *buildmap_place_get_record (int place) { *************** *** 168,172 **** } ! static BuildMapPlace *buildmap_place_get_record_sorted (int place) { --- 175,183 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ static BuildMapPlace *buildmap_place_get_record_sorted (int place) { *************** *** 184,188 **** } ! int buildmap_place_get_point_sorted (int place) { --- 195,203 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ int buildmap_place_get_point_sorted (int place) { *************** *** 192,195 **** --- 207,216 ---- } + /** + * @brief + * @param place + * @param longitude + * @param latitude + */ void buildmap_place_get_position (int place, int *longitude, int *latitude) { *************** *** 200,204 **** } ! void buildmap_place_get_position_sorted (int place, int *longitude, int *latitude) { --- 221,230 ---- } ! /** ! * @brief ! * @param place ! * @param longitude ! * @param latitude ! */ void buildmap_place_get_position_sorted (int place, int *longitude, int *latitude) { *************** *** 210,214 **** } ! int buildmap_place_get_sorted (int place) { --- 236,244 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ int buildmap_place_get_sorted (int place) { *************** *** 222,226 **** } ! int buildmap_place_get_name_sorted (int place) { --- 252,260 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ int buildmap_place_get_name_sorted (int place) { *************** *** 228,232 **** } ! int buildmap_place_get_square_sorted (int place) { --- 262,270 ---- } ! /** ! * @brief ! * @param place ! * @return ! */ int buildmap_place_get_square_sorted (int place) { *************** *** 235,238 **** --- 273,282 ---- } + /** + * @brief + * @param r1 + * @param r2 + * @return + */ static int buildmap_place_compare (const void *r1, const void *r2) { *************** *** 270,273 **** --- 314,320 ---- } + /** + * @brief + */ static void buildmap_place_sort (void) { *************** *** 319,323 **** } ! static void buildmap_place_save (void) { --- 366,372 ---- } ! /** ! * @brief ! */ static void buildmap_place_save (void) { *************** *** 468,472 **** } ! static void buildmap_place_summary (void) { --- 517,523 ---- } ! /** ! * @brief ! */ static void buildmap_place_summary (void) { *************** *** 476,480 **** } ! static void buildmap_place_reset (void) { --- 527,533 ---- } ! /** ! * @brief ! */ static void buildmap_place_reset (void) { *************** *** 497,501 **** } ! static buildmap_db_module BuildMapPlaceModule = { "place", --- 550,556 ---- } ! /** ! * @brief ! */ static buildmap_db_module BuildMapPlaceModule = { "place", *************** *** 505,512 **** buildmap_place_reset }; ! ! static void buildmap_place_register (void) { buildmap_db_register (&BuildMapPlaceModule); } - --- 560,568 ---- buildmap_place_reset }; ! ! /** ! * @brief ! */ static void buildmap_place_register (void) { buildmap_db_register (&BuildMapPlaceModule); } Index: buildmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_street.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** buildmap_street.c 29 Mar 2009 11:54:47 -0000 1.9 --- buildmap_street.c 12 May 2009 13:53:32 -0000 1.10 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 175,178 **** --- 176,185 ---- offset = StreetCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned street table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (Street[block] == NULL) { Index: buildmap_polygon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_polygon.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildmap_polygon.c 24 Dec 2007 19:26:36 -0000 1.14 --- buildmap_polygon.c 12 May 2009 13:53:32 -0000 1.15 *************** *** 1,7 **** ! /* buildmap_polygon.c - Build a line table & index for RoadMap. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 20,39 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * int buildmap_polygon_add_landmark ! * (int landid, char cfcc, RoadMapString name); ! * int buildmap_polygon_add (int landid, RoadMapString cenid, int polyid); ! * int buildmap_polygon_add_line ! * (RoadMapString cenid, int polyid, int tlid, int side); ! * ! * int buildmap_polygon_use_line (int tlid); ! * ! * These functions are used to build a table of lines from ! * the Tiger maps. The objective is double: (1) reduce the size of ! * the Tiger data by sharing all duplicated information and ! * (2) produce the index data to serve as the basis for a fast ! * search mechanism for streets in roadmap. * * This module considers a single area to be described by a unique landmark --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief Build a line table & index for RoadMap. * * This module considers a single area to be described by a unique landmark *************** *** 488,491 **** --- 477,486 ---- offset = LandmarkCount % BUILDMAP_BLOCK; + if (block >= BUILDMAP_BLOCK) { + buildmap_fatal (0, + "Underdimensioned landmark table (block %d, BUILDMAP_BLOCK %d)", + block, BUILDMAP_BLOCK); + } + if (Landmark[block] == NULL) { Index: buildmap_dbwrite.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_dbwrite.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_dbwrite.c 31 Jul 2007 15:31:16 -0000 1.7 --- buildmap_dbwrite.c 12 May 2009 13:53:32 -0000 1.8 *************** *** 1,7 **** ! /* buildmap_dbwrite.c - a module to write a roadmap database. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009 Danny Backx. * * This file is part of RoadMap. *************** *** 20,35 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * #include "buildmap.h" ! * ! * int buildmap_db_open (char *path, char *name); ! * ! * buildmap_db *buildmap_db_add_section (buildmap_db *parent, char *name); ! * int buildmap_db_add_data (buildmap_db *section, int count, int size); ! * void *buildmap_db_get_data (buildmap_db *section); ! * ! * void buildmap_db_close (void); */ --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief buildmap_dbwrite.c - a module to write a roadmap database. */ *************** *** 63,67 **** static int BuildmapModuleCount = 0; ! static void buildmap_db_repair_tree (buildmap_db *section) { --- 56,63 ---- static int BuildmapModuleCount = 0; ! /** ! * @brief ! * @param section ! */ static void buildmap_db_repair_tree (buildmap_db *section) { *************** *** 77,81 **** } ! static int buildmap_db_extend (int size) { --- 73,80 ---- } ! /** ! * @brief ! * @param size ! */ static int buildmap_db_extend (int size) { *************** *** 120,124 **** } ! static void buildmap_db_propagate (buildmap_db *parent, int size) { --- 119,127 ---- } ! /** ! * @brief ! * @param parent ! * @param size ! */ static void buildmap_db_propagate (buildmap_db *parent, int size) { *************** *** 130,134 **** } ! static void buildmap_db_update_tree (buildmap_db *parent, buildmap_db *section) { --- 133,141 ---- } ! /** ! * @brief ! * @param parent ! * @param section ! */ static void buildmap_db_update_tree (buildmap_db *parent, buildmap_db *section) { *************** *** 153,157 **** } ! int buildmap_db_open (const char *path, const char *name) { --- 160,169 ---- } ! /** ! * @brief ! * @param path ! * @param name ! * @return ! */ int buildmap_db_open (const char *path, const char *name) { *************** *** 188,192 **** } ! buildmap_db *buildmap_db_add_section (buildmap_db *parent, const char *name) { --- 200,209 ---- } ! /** ! * @brief ! * @param parent ! * @param name ! * @return ! */ buildmap_db *buildmap_db_add_section (buildmap_db *parent, const char *name) { *************** *** 244,248 **** } ! int buildmap_db_add_data (buildmap_db *section, int count, int size) { --- 261,271 ---- } ! /** ! * @brief ! * @param section ! * @param count ! * @param size ! * @return ! */ int buildmap_db_add_data (buildmap_db *section, int count, int size) { *************** *** 277,281 **** } ! void *buildmap_db_get_data (buildmap_db *section) { --- 300,308 ---- } ! /** ! * @brief ! * @param section ! * @return ! */ void *buildmap_db_get_data (buildmap_db *section) { *************** *** 283,287 **** } ! static void buildmap_db_free (buildmap_db *node) { --- 310,318 ---- } ! /** ! * @brief ! * @param node ! * @return ! */ static void buildmap_db_free (buildmap_db *node) { *************** *** 299,303 **** } ! void buildmap_db_close (void) { --- 330,337 ---- } ! /** ! * @brief ! * @return ! */ void buildmap_db_close (void) { *************** *** 333,337 **** } ! buildmap_db *buildmap_db_add_child (buildmap_db *parent, char *name, --- 367,378 ---- } ! /** ! * @brief ! * @param parent ! * @param name ! * @param count ! * @param size ! * @return ! */ buildmap_db *buildmap_db_add_child (buildmap_db *parent, char *name, *************** *** 359,362 **** --- 400,407 ---- */ + /** + * @brief register a module that can write a map + * @param module pointer to the required structure + */ void buildmap_db_register (const buildmap_db_module *module) { *************** *** 376,380 **** } ! void buildmap_db_sort (void) { --- 421,428 ---- } ! /** ! * @brief ! * @return ! */ void buildmap_db_sort (void) { *************** *** 389,392 **** --- 437,443 ---- + /** + * @brief save the map + */ void buildmap_db_save (void) { *************** *** 400,404 **** } ! void buildmap_db_summary (void) { --- 451,458 ---- } ! /** ! * @brief ! * @return ! */ void buildmap_db_summary (void) { *************** *** 412,416 **** } ! void buildmap_db_reset (void) { --- 466,473 ---- } ! /** ! * @brief ! * @return ! */ void buildmap_db_reset (void) { *************** *** 423,425 **** } } - --- 480,481 ---- |