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-09 07:43:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15321 Added Files: rdmxchange_line.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_line.c --- /* roadmap_line.c - Manage the 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_line.h" static char *RoadMapLineType = "RoadMapLineContext"; typedef struct { char *type; RoadMapLine *Line; int LineCount; RoadMapLineBySquare *LineBySquare1; int LineBySquare1Count; int *LineIndex2; int LineIndex2Count; RoadMapLineBySquare *LineBySquare2; int LineBySquare2Count; } RoadMapLineContext; static RoadMapLineContext *RoadMapLineActive = NULL; static void rdmxchange_line_register_export (void); static void *roadmap_line_map (roadmap_db *root) { RoadMapLineContext *context; roadmap_db *line_table; roadmap_db *index2_table; roadmap_db *square1_table; roadmap_db *square2_table; context = (RoadMapLineContext *) malloc (sizeof(RoadMapLineContext)); if (context == NULL) { roadmap_log (ROADMAP_ERROR, "no more memory"); return NULL; } context->type = RoadMapLineType; line_table = roadmap_db_get_subsection (root, "data"); square1_table = roadmap_db_get_subsection (root, "bysquare1"); square2_table = roadmap_db_get_subsection (root, "bysquare2"); index2_table = roadmap_db_get_subsection (root, "index2"); context->Line = (RoadMapLine *) roadmap_db_get_data (line_table); context->LineCount = roadmap_db_get_count (line_table); if (roadmap_db_get_size (line_table) != context->LineCount * sizeof(RoadMapLine)) { roadmap_log (ROADMAP_ERROR, "invalid line/data structure"); goto roadmap_line_map_abort; } context->LineBySquare1 = (RoadMapLineBySquare *) roadmap_db_get_data (square1_table); context->LineBySquare1Count = roadmap_db_get_count (square1_table); if (roadmap_db_get_size (square1_table) != context->LineBySquare1Count * sizeof(RoadMapLineBySquare)) { roadmap_log (ROADMAP_ERROR, "invalid line/bysquare1 structure"); goto roadmap_line_map_abort; } context->LineIndex2 = (int *) roadmap_db_get_data (index2_table); context->LineIndex2Count = roadmap_db_get_count (index2_table); if (roadmap_db_get_size (index2_table) != context->LineIndex2Count * sizeof(int)) { roadmap_log (ROADMAP_ERROR, "invalid line/index2 structure"); goto roadmap_line_map_abort; } context->LineBySquare2 = (RoadMapLineBySquare *) roadmap_db_get_data (square2_table); context->LineBySquare2Count = roadmap_db_get_count (square2_table); if (roadmap_db_get_size (square2_table) != context->LineBySquare2Count * sizeof(RoadMapLineBySquare)) { roadmap_log (ROADMAP_ERROR, "invalid line/bysquare2 structure"); goto roadmap_line_map_abort; } rdmxchange_line_register_export(); return context; roadmap_line_map_abort: free(context); return NULL; } static void roadmap_line_activate (void *context) { RoadMapLineContext *line_context = (RoadMapLineContext *) context; if ((line_context != NULL) && (line_context->type != RoadMapLineType)) { roadmap_log (ROADMAP_FATAL, "invalid line context activated"); } RoadMapLineActive = line_context; } static void roadmap_line_unmap (void *context) { RoadMapLineContext *line_context = (RoadMapLineContext *) context; if (line_context->type != RoadMapLineType) { roadmap_log (ROADMAP_FATAL, "unmapping invalid line context"); } free (line_context); } roadmap_db_handler RoadMapLineExport = { "dictionary", roadmap_line_map, roadmap_line_activate, roadmap_line_unmap }; 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); } static void rdmxchange_line_export_data (FILE *file) { int i; int j; int *index2; RoadMapLine *line; RoadMapLineBySquare *bysquare; 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; for (i = 0; i < RoadMapLineActive->LineIndex2Count; ++i, ++index2) { fprintf (file, "%d\n", *index2); } fprintf (file, "\n"); 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"); } static RdmXchangeExport RdmXchangeLineExport = { "line", rdmxchange_line_export_head, rdmxchange_line_export_data }; static void rdmxchange_line_register_export (void) { rdmxchange_main_register_export (&RdmXchangeLineExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:43:47
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15290 Added Files: rdmxchange_index.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_index.c --- /* rdmxchange_index.c - Export the directory index used to select a map. * * 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_math.h" #include "roadmap_hash.h" #include "roadmap_dbread.h" #include "roadmap_db_index.h" #include "rdmxchange.h" static char RoadMapIndexType[] = "RoadMapIndexType"; typedef struct { char *type; RoadMapAuthority *authority; int authority_count; RoadMapTerritory *territory; int territory_count; RoadMapMap *map; int map_count; RoadMapString *name; int name_count; RoadMapString *city; int city_count; } RoadMapIndexContext; static RoadMapIndexContext *RoadMapIndexActive = NULL; static void rdmxchange_index_register_export (void); static void *rdmxchange_index_map (roadmap_db *root) { roadmap_db *authority_table; roadmap_db *territory_table; roadmap_db *map_table; roadmap_db *name_table; roadmap_db *city_table; RoadMapIndexContext *context; context = malloc (sizeof(RoadMapIndexContext)); roadmap_check_allocated(context); context->type = RoadMapIndexType; authority_table = roadmap_db_get_subsection (root, "authority"); territory_table = roadmap_db_get_subsection (root, "territory"); map_table = roadmap_db_get_subsection (root, "map"); name_table = roadmap_db_get_subsection (root, "name"); city_table = roadmap_db_get_subsection (root, "city"); context->authority = (RoadMapAuthority *) roadmap_db_get_data (authority_table); context->territory = (RoadMapTerritory *) roadmap_db_get_data (territory_table); context->map = (RoadMapMap *) roadmap_db_get_data (map_table); context->name = (RoadMapString *) roadmap_db_get_data (name_table); context->city = (RoadMapString *) roadmap_db_get_data (city_table); context->authority_count = roadmap_db_get_count (authority_table); context->territory_count = roadmap_db_get_count (territory_table); context->map_count = roadmap_db_get_count (map_table); context->name_count = roadmap_db_get_count (name_table); context->city_count = roadmap_db_get_count (city_table); if (roadmap_db_get_size(authority_table) != context->authority_count * sizeof(RoadMapAuthority)) { roadmap_log (ROADMAP_FATAL, "invalid index/authority structure"); } if (roadmap_db_get_size(territory_table) != context->territory_count * sizeof(RoadMapTerritory)) { roadmap_log (ROADMAP_FATAL, "invalid index/territory structure"); } if (roadmap_db_get_size(map_table) != context->map_count * sizeof(RoadMapMap)) { roadmap_log (ROADMAP_FATAL, "invalid index/map structure"); } if (roadmap_db_get_size(name_table) != context->name_count * sizeof(RoadMapString)) { roadmap_log (ROADMAP_FATAL, "invalid index/name structure"); } if (roadmap_db_get_size(city_table) != context->city_count * sizeof(RoadMapString)) { roadmap_log (ROADMAP_FATAL, "invalid index/city structure"); } rdmxchange_index_register_export(); return context; } static void rdmxchange_index_activate (void *context) { RoadMapIndexActive = (RoadMapIndexContext *) context; } static void rdmxchange_index_unmap (void *context) { RoadMapIndexContext *index_context = (RoadMapIndexContext *) context; if (index_context->type != RoadMapIndexType) { roadmap_log (ROADMAP_FATAL, "cannot unmap (invalid context type)"); } if (index_context == RoadMapIndexActive) { RoadMapIndexActive = NULL; } free (index_context); } roadmap_db_handler RoadMapIndexExport = { "index", rdmxchange_index_map, rdmxchange_index_activate, rdmxchange_index_unmap }; 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); } static void rdmxchange_index_export_data (FILE *file) { int i; RoadMapAuthority *authority; RoadMapTerritory *territory; RoadMapMap *map; RoadMapString *name; RoadMapString *city; 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; for (i = 0; i < RoadMapIndexActive->name_count; ++i) { fprintf (file, "%d\n", name[i]); } fprintf (file, "\n"); fprintf (file, "table index/city\n"); city = RoadMapIndexActive->city; for (i = 0; i < RoadMapIndexActive->city_count; ++i) { fprintf (file, "%d\n", city[i]); } fprintf (file, "\n"); } static RdmXchangeExport RdmXchangeIndexExport = { "index", rdmxchange_index_export_head, rdmxchange_index_export_data }; static void rdmxchange_index_register_export (void) { rdmxchange_main_register_export (&RdmXchangeIndexExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:43:43
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15270 Added Files: rdmxchange.h Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange.h --- /* rdmxchange.h - general definitions use by the rdmxchange program. * * 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 */ #ifndef INCLUDED__RDMXCHANGE__H #define INCLUDED__RDMXCHANGE__H #include <stdio.h> #include "roadmap_dbread.h" typedef void (*RdmXchangeExporter) (FILE *output); typedef struct rdmxchange_export_record { const char *type; RdmXchangeExporter head; RdmXchangeExporter data; } RdmXchangeExport; void rdmxchange_main_register_export (RdmXchangeExport *export); extern roadmap_db_handler RoadMapDictionaryExport; extern roadmap_db_handler RoadMapIndexExport; extern roadmap_db_handler RoadMapLineExport; extern roadmap_db_handler RoadMapMetadataExport; extern roadmap_db_handler RoadMapPointExport; extern roadmap_db_handler RoadMapPolygonExport; extern roadmap_db_handler RoadMapShapeExport; extern roadmap_db_handler RoadMapSquareExport; #endif // INCLUDED__RDMXCHANGE__H |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:43:30
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15244 Added Files: rdmxchange_dictionary.c Log Message: A tool to convert a map file into or from an architecture-independent format (unfinished) --- NEW FILE: rdmxchange_dictionary.c --- /* rdmxchange_dictionary.c - Export a Map dictionary table & index. * * 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_dictionary.h" struct dictionary_volume { char *name; struct dictionary_volume *next; struct roadmap_dictionary_tree *tree; int tree_count; struct roadmap_dictionary_reference *node; int node_count; unsigned int *string_index; int string_count; char *data; int size; }; static struct dictionary_volume *DictionaryVolume = NULL; static void rdmxchange_dictionary_register_export (void); static struct dictionary_volume * rdmxchange_dictionary_initialize_one (roadmap_db *child) { roadmap_db *table; struct dictionary_volume *dictionary; /* Retrieve all the database sections: */ dictionary = malloc (sizeof(struct dictionary_volume)); roadmap_check_allocated(dictionary); dictionary->name = roadmap_db_get_name (child); table = roadmap_db_get_subsection (child, "data"); dictionary->data = roadmap_db_get_data (table); dictionary->size = roadmap_db_get_size (table); table = roadmap_db_get_subsection (child, "tree"); dictionary->tree = (struct roadmap_dictionary_tree *) roadmap_db_get_data (table); dictionary->tree_count = roadmap_db_get_count (table); table = roadmap_db_get_subsection (child, "node"); dictionary->node = (struct roadmap_dictionary_reference *) roadmap_db_get_data (table); dictionary->node_count = roadmap_db_get_count (table); table = roadmap_db_get_subsection (child, "index"); dictionary->string_index = (unsigned int *) roadmap_db_get_data (table); dictionary->string_count = roadmap_db_get_count (table); return dictionary; } static void *rdmxchange_dictionary_map (roadmap_db *parent) { roadmap_db *child; struct dictionary_volume *volume; struct dictionary_volume *first = NULL; for (child = roadmap_db_get_first(parent); child != NULL; child = roadmap_db_get_next(child)) { volume = rdmxchange_dictionary_initialize_one (child); volume->next = first; first = volume; } rdmxchange_dictionary_register_export(); return first; } static void rdmxchange_dictionary_activate (void *context) { DictionaryVolume = (struct dictionary_volume *) context; } static void rdmxchange_dictionary_unmap (void *context) { struct dictionary_volume *this = (struct dictionary_volume *) context; if (this == DictionaryVolume) { DictionaryVolume = NULL; } while (this != NULL) { struct dictionary_volume *next = this->next; free (this); this = next; } } roadmap_db_handler RoadMapDictionaryExport = { "dictionary", rdmxchange_dictionary_map, rdmxchange_dictionary_activate, rdmxchange_dictionary_unmap }; static void rdmxchange_dictionary_export_head (FILE *file) { struct dictionary_volume *volume; 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); } } static void rdmxchange_dictionary_export_data (FILE *file) { int i; char *data; char *data_end; unsigned int *index; struct dictionary_volume *volume; RoadMapDictionaryReference *node; RoadMapDictionaryTree *tree; 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; for (; data < data_end; data += (strlen(data) + 1)) { fprintf (file, "%s\n", data); } fprintf (file, "\n"); fprintf (file, "table string/%s/index\n", volume->name); index = volume->string_index; for (i = 0; i < volume->string_count; ++i, ++index) { fprintf (file, "%d\n", *index); } fprintf (file, "\n"); } } static RdmXchangeExport RdmXchangeDictionaryExport = { "dictionary", rdmxchange_dictionary_export_head, rdmxchange_dictionary_export_data }; static void rdmxchange_dictionary_register_export (void) { rdmxchange_main_register_export (&RdmXchangeDictionaryExport); } |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:39:51
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14782 Modified Files: roadmap_dictionary.c Log Message: Remove obsolete constant Index: roadmap_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_dictionary.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_dictionary.c 13 Apr 2003 20:04:59 -0000 1.2 --- roadmap_dictionary.c 9 Jan 2006 07:39:43 -0000 1.3 *************** *** 65,69 **** }; - #define ROADMAP_DICTIONARY_MAX 16 static struct dictionary_volume *DictionaryVolume = NULL; --- 65,68 ---- |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:39:06
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14709 Modified Files: roadmap_db_line.h Log Message: Cleanup & updates Index: roadmap_db_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_line.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_db_line.h 2 Oct 2004 09:01:49 -0000 1.2 --- roadmap_db_line.h 9 Jan 2006 07:38:59 -0000 1.3 *************** *** 25,41 **** * The RoadMap lines are described by the following table: * ! * line the ID of the line and its from and to points. ! * The lines are sorted by square. ! * bysquare an index of lines per square. ! * bysquare2 A given line may have one end in a different square: ! * this other index covers this very case. */ ! #ifndef _ROADMAP_DB_LINE__H_ ! #define _ROADMAP_DB_LINE__H_ #include "roadmap_types.h" ! typedef struct { /* table line */ int from; --- 25,43 ---- * The RoadMap lines are described by the following table: * ! * line/data The ID of the line and its from and to points. ! * The lines are sorted by square. ! * line/bysquare1 An index of lines per square. ! * line/index2 This index table points to line/data and is pointed ! * to from line/bysquare2. This is used to build lists. ! * line/bysquare2 A given line may have one end in a different square: ! * this other index covers this very case. */ ! #ifndef INCLUDED__ROADMAP_DB_LINE__H ! #define INCLUDED__ROADMAP_DB_LINE__H #include "roadmap_types.h" ! typedef struct { /* table line/data */ int from; *************** *** 44,48 **** } RoadMapLine; ! typedef struct { /* tables bysquare1 and bysquare2 */ int first[ROADMAP_CATEGORY_RANGE]; --- 46,50 ---- } RoadMapLine; ! typedef struct { /* tables line/bysquare1 and line/bysquare2 */ int first[ROADMAP_CATEGORY_RANGE]; *************** *** 51,54 **** } RoadMapLineBySquare; ! #endif // _ROADMAP_DB_LINE__H_ --- 53,58 ---- } RoadMapLineBySquare; ! /* Table line/index2 is an array of int. */ ! ! #endif // INCLUDED__ROADMAP_DB_LINE__H |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:37:17
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14537 Modified Files: roadmap_db_polygon.h Log Message: Cleanup & updates Index: roadmap_db_polygon.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_db_polygon.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_db_polygon.h 8 Nov 2004 07:51:40 -0000 1.3 --- roadmap_db_polygon.h 9 Jan 2006 07:37:02 -0000 1.4 *************** *** 1,17 **** /* roadmap_polygon.h - the format of the polygon table used by RoadMap. * * The RoadMap polygons are described by the following tables: * ! * polygon.bysquare the list of polygons located in each square. ! * polygon.head for each polygon, the category and list of lines. ! * polygon.points the list of points defining the polygons border. */ ! #ifndef _ROADMAP_DB_POLYGON__H_ ! #define _ROADMAP_DB_POLYGON__H_ #include "roadmap_types.h" ! typedef struct { /* table polygon.head */ unsigned short first; --- 1,39 ---- /* roadmap_polygon.h - the format of the polygon table used by RoadMap. * + * + * 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 + * + * SYNOPSYS: + * * The RoadMap polygons are described by the following tables: * ! * polygon/head for each polygon, the category and list of lines. ! * polygon/points the list of points defining the polygons border. */ ! #ifndef INCLUDED__ROADMAP_DB_POLYGON__H ! #define INCLUDED__ROADMAP_DB_POLYGON__H #include "roadmap_types.h" ! typedef struct { /* table polygon/head */ unsigned short first; *************** *** 30,34 **** } RoadMapPolygon; ! typedef struct { /* table polygon.lines */ int point; --- 52,56 ---- } RoadMapPolygon; ! typedef struct { /* table polygon/points */ int point; *************** *** 36,39 **** } RoadMapPolygonPoint; ! #endif // _ROADMAP_DB_POLYGON__H_ --- 58,61 ---- } RoadMapPolygonPoint; ! #endif // INCLUDED__ROADMAP_DB_POLYGON__H |
From: Pascal F M. <pas...@us...> - 2006-01-09 07:36:34
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14458 Modified Files: roadmap_index.c Log Message: Fix compiler errors Index: roadmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_index.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_index.c 3 Jan 2006 04:15:00 -0000 1.2 --- roadmap_index.c 9 Jan 2006 07:36:26 -0000 1.3 *************** *** 156,173 **** } ! if (context->territory_is_covered == NULL) { /* First activation. */ ! context->names = roadmap_dictionary_open ("name"); ! context->cities = roadmap_dictionary_open ("city"); ! context->classes = roadmap_dictionary_open ("class"); ! context->files = roadmap_dictionary_open ("file"); index_context->hash = roadmap_hash_new ("territoryIndex", index_context->territory_count); ! context->territory_is_covered = ! (char *) malloc(context->territory_count); } } --- 156,173 ---- } ! if (index_context->territory_is_covered == NULL) { /* First activation. */ ! index_context->names = roadmap_dictionary_open ("name"); ! index_context->cities = roadmap_dictionary_open ("city"); ! index_context->classes = roadmap_dictionary_open ("class"); ! index_context->files = roadmap_dictionary_open ("file"); index_context->hash = roadmap_hash_new ("territoryIndex", index_context->territory_count); ! index_context->territory_is_covered = ! (char *) malloc(index_context->territory_count); } } |
From: Paul F. <pg...@us...> - 2006-01-03 19:37:23
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9524 Modified Files: roadmap_start.c Log Message: move "Track" menu items under "Places", to conserve screen space Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** roadmap_start.c 3 Jan 2006 19:33:44 -0000 1.91 --- roadmap_start.c 3 Jan 2006 19:37:14 -0000 1.92 *************** *** 546,556 **** "deletemaps", - ROADMAP_MENU "Track", - - "tracksave", - "trackclear", - "tracktoroute", - "tracktoggle", - ROADMAP_MENU "Trip", --- 546,549 ---- *************** *** 581,584 **** --- 574,585 ---- "mergepersonalwaypoints", + RoadMapFactorySeparator, + + "tracksave", + "trackclear", + "tracktoroute", + "tracktoggle", + + ROADMAP_MENU "Help", |
From: Paul F. <pg...@us...> - 2006-01-03 19:33:59
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8238 Modified Files: roadmap_start.c roadmap_trip.c roadmap_trip.h Log Message: clean up API between roadmap_start.c and roadmap_trip.c. these diffs started out to be a bigger change to how trip names are managed, but i backed off. what's left is mostly cosmetic and (to me) clearer. Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** roadmap_trip.c 8 Dec 2005 21:13:55 -0000 1.43 --- roadmap_trip.c 3 Jan 2006 19:33:44 -0000 1.44 *************** *** 1833,1837 **** ! const char * roadmap_trip_current (void) { return roadmap_config_get (&RoadMapConfigTripName); } --- 1833,1837 ---- ! static const char *roadmap_trip_current() { return roadmap_config_get (&RoadMapConfigTripName); } *************** *** 1841,1844 **** --- 1841,1846 ---- roadmap_trip_clear (); + + // FIXME choose a unique-ish name roadmap_config_set (&RoadMapConfigTripName, "default.gpx"); *************** *** 1887,1897 **** /* File dialog support */ static void roadmap_trip_file_dialog_ok (const char *filename, const char *mode) { if (mode[0] == 'w') { ! roadmap_trip_save (filename, 1); } else { ! roadmap_trip_load (filename, 0, 0); } } --- 1889,1902 ---- /* File dialog support */ + static int roadmap_trip_load_file (const char *name, int silent, int merge); + static int roadmap_trip_save_file (const char *name, int force); + static void roadmap_trip_file_dialog_ok (const char *filename, const char *mode) { if (mode[0] == 'w') { ! roadmap_trip_save_file (filename, 1); } else { ! roadmap_trip_load_file (filename, 0, 0); } } *************** *** 1900,1904 **** (const char *filename, const char *mode) { ! roadmap_trip_load (filename, 0, 1); } --- 1905,1909 ---- (const char *filename, const char *mode) { ! roadmap_trip_load_file (filename, 0, 1); } *************** *** 1920,1942 **** ! int roadmap_trip_load (const char *name, int silent, int merge) { int ret; ! const char *trip_path = NULL; queue tmp_waypoint_list, tmp_route_list, tmp_track_list; - if (name == NULL || name[0] == '\0') { - if (merge) { - roadmap_trip_file_merge_dialog ("r"); - } else { - roadmap_trip_file_dialog ("r"); - } - return 0; - } - if (! roadmap_path_is_full_path (name)) ! trip_path = roadmap_path_trips (); ! roadmap_log (ROADMAP_DEBUG, "roadmap_trip_load '%s'", name); QUEUE_INIT(&tmp_waypoint_list); --- 1925,1938 ---- ! static int roadmap_trip_load_file (const char *name, int silent, int merge) { int ret; ! const char *path = NULL; queue tmp_waypoint_list, tmp_route_list, tmp_track_list; if (! roadmap_path_is_full_path (name)) ! path = roadmap_path_trips (); ! roadmap_log (ROADMAP_DEBUG, "roadmap_trip_load_file '%s'", name); QUEUE_INIT(&tmp_waypoint_list); *************** *** 1944,1948 **** QUEUE_INIT(&tmp_track_list); ! ret = roadmap_gpx_read_file (trip_path, name, &tmp_waypoint_list, &tmp_route_list, &tmp_track_list); --- 1940,1944 ---- QUEUE_INIT(&tmp_track_list); ! ret = roadmap_gpx_read_file (path, name, &tmp_waypoint_list, &tmp_route_list, &tmp_track_list); *************** *** 2015,2070 **** } ! void roadmap_trip_save (const char *name, int force) { ! const char *trip_path = NULL; ! if (name == NULL || name[0] == '\0') { ! roadmap_trip_file_dialog ("w"); ! return; } if (! roadmap_path_is_full_path (name)) { ! trip_path = roadmap_path_trips (); } ! if (!force && !RoadMapTripModified) return; /* Always save if user-initiated. */ roadmap_log (ROADMAP_DEBUG, "trip save_forced, or modified '%s'", name); ! roadmap_gpx_write_file (trip_path, name, &RoadMapTripWaypointHead, &RoadMapTripRouteHead, &RoadMapTripTrackHead); } void roadmap_trip_save_screenshot (void) { const char *extension = ".png"; ! const char *trip_path = roadmap_path_trips (); ! const char *trip_name = roadmap_trip_current (); unsigned int total_length; ! unsigned int trip_length; char *dot; char *picture_name; ! trip_length = strlen (trip_name); /* Shorten it later. */ ! dot = strrchr (trip_name, '.'); if (dot != NULL) { ! trip_length -= strlen (dot); } ! total_length = trip_length + strlen (trip_path) + strlen (extension) + 12; picture_name = malloc (total_length); roadmap_check_allocated (picture_name); ! memcpy (picture_name, trip_name, trip_length); sprintf (picture_name, "%s/%*.*s-%010d%s", ! trip_path, ! trip_length, trip_length, trip_name, (int) time (NULL), extension); roadmap_canvas_save_screenshot (picture_name); --- 2011,2096 ---- } + int roadmap_trip_load (int silent, int merge) { + int ret; + const char *name = roadmap_trip_current(); + ret = roadmap_trip_load_file ( name, silent, merge); ! if (ret == 0) return 0; ! return ret; ! } ! int roadmap_trip_load_ask (int merge) { ! ! if (merge) { ! roadmap_trip_file_merge_dialog ("r"); ! } else { ! roadmap_trip_file_dialog ("r"); } + return 0; + + } + + static int roadmap_trip_save_file (const char *name, int force) { + + const char *path = NULL; if (! roadmap_path_is_full_path (name)) { ! path = roadmap_path_trips (); } ! if (!force && !RoadMapTripModified) return 1; /* Always save if user-initiated. */ roadmap_log (ROADMAP_DEBUG, "trip save_forced, or modified '%s'", name); ! return roadmap_gpx_write_file (path, name, &RoadMapTripWaypointHead, &RoadMapTripRouteHead, &RoadMapTripTrackHead); } + int roadmap_trip_save (int force) { + + int ret; + const char *name = roadmap_trip_current(); + + ret = roadmap_trip_save_file ( name, force); + + return ret; + } + + void roadmap_trip_save_as(int force) { + roadmap_trip_file_dialog ("w"); + } + + void roadmap_trip_save_screenshot (void) { const char *extension = ".png"; ! const char *path = roadmap_path_trips (); ! const char *name = roadmap_trip_current (); unsigned int total_length; ! unsigned int name_length; char *dot; char *picture_name; ! name_length = strlen (name); /* Shorten it later. */ ! dot = strrchr (name, '.'); if (dot != NULL) { ! name_length -= strlen (dot); } ! total_length = name_length + strlen (path) + strlen (extension) + 12; picture_name = malloc (total_length); roadmap_check_allocated (picture_name); ! memcpy (picture_name, name, name_length); sprintf (picture_name, "%s/%*.*s-%010d%s", ! path, ! name_length, name_length, name, (int) time (NULL), extension); roadmap_canvas_save_screenshot (picture_name); Index: roadmap_trip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_trip.h 7 Dec 2005 18:57:35 -0000 1.19 --- roadmap_trip.h 3 Jan 2006 19:33:44 -0000 1.20 *************** *** 76,86 **** void roadmap_trip_clear (void); - const char *roadmap_trip_current (void); - /* In the two primitives that follow, the name is either NULL (i.e. * open a dialog to let the user enter one), or an explicit name. */ ! int roadmap_trip_load (const char *name, int silent, int merge); ! void roadmap_trip_save (const char *name, int force); void roadmap_trip_save_screenshot (void); --- 76,86 ---- void roadmap_trip_clear (void); /* In the two primitives that follow, the name is either NULL (i.e. * open a dialog to let the user enter one), or an explicit name. */ ! int roadmap_trip_load (int silent, int merge); ! int roadmap_trip_load_ask (int merge); ! int roadmap_trip_save (int force); ! void roadmap_trip_save_as (int force); void roadmap_trip_save_screenshot (void); Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** roadmap_start.c 8 Dec 2005 21:13:55 -0000 1.90 --- roadmap_start.c 3 Jan 2006 19:33:44 -0000 1.91 *************** *** 178,197 **** static void roadmap_start_open_trip (void) { ! roadmap_trip_load (NULL, 0, 0); } static void roadmap_start_merge_trip (void) { ! roadmap_trip_load (NULL, 0, 1); } static void roadmap_start_save_trip (void) { ! roadmap_trip_save (roadmap_trip_current(), 1); } static void roadmap_start_save_trip_as (void) { ! roadmap_trip_save (NULL, 1); } --- 178,197 ---- static void roadmap_start_open_trip (void) { ! roadmap_trip_load_ask (0); } static void roadmap_start_merge_trip (void) { ! roadmap_trip_load_ask (1); } static void roadmap_start_save_trip (void) { ! roadmap_trip_save (1); } static void roadmap_start_save_trip_as (void) { ! roadmap_trip_save_as (1); } *************** *** 986,991 **** roadmap_trip_restore_focus (); ! if ((roadmap_trip_current() == NULL) || ! (! roadmap_trip_load (roadmap_trip_current(), 1, 0))) { roadmap_start_create_trip (); } --- 986,990 ---- roadmap_trip_restore_focus (); ! if ( ! roadmap_trip_load (1, 0)) { roadmap_start_create_trip (); } *************** *** 1007,1011 **** roadmap_track_autosave (); roadmap_landmark_save (); ! roadmap_trip_save (roadmap_trip_current(), 0); roadmap_config_save (0); } --- 1006,1010 ---- roadmap_track_autosave (); roadmap_landmark_save (); ! roadmap_trip_save (0); roadmap_config_save (0); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:15:10
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3280 Modified Files: roadmap_index.c Log Message: Delay some initializations after all the tables have been mapped Index: roadmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_index.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_index.c 2 Jan 2006 09:14:02 -0000 1.1 --- roadmap_index.c 3 Jan 2006 04:15:00 -0000 1.2 *************** *** 141,150 **** } ! context->names = roadmap_dictionary_open ("name"); ! context->cities = roadmap_dictionary_open ("city"); ! context->classes = roadmap_dictionary_open ("class"); ! context->files = roadmap_dictionary_open ("file"); ! ! context->territory_is_covered = (char *) malloc(context->territory_count); return context; --- 141,145 ---- } ! context->territory_is_covered = NULL; return context; *************** *** 161,166 **** } ! index_context->hash = ! roadmap_hash_new ("territoryIndex", index_context->territory_count); } RoadMapIndexActive = index_context; --- 156,174 ---- } ! if (context->territory_is_covered == NULL) { ! ! /* First activation. */ ! ! context->names = roadmap_dictionary_open ("name"); ! context->cities = roadmap_dictionary_open ("city"); ! context->classes = roadmap_dictionary_open ("class"); ! context->files = roadmap_dictionary_open ("file"); ! ! index_context->hash = ! roadmap_hash_new ("territoryIndex", index_context->territory_count); ! ! context->territory_is_covered = ! (char *) malloc(context->territory_count); ! } } RoadMapIndexActive = index_context; *************** *** 179,185 **** } ! roadmap_hash_free (index_context->hash); ! free (index_context->territory_is_covered); free (index_context); } --- 187,195 ---- } ! if (index_context->territory_is_covered != NULL) { ! roadmap_hash_free (index_context->hash); ! free (index_context->territory_is_covered); ! } free (index_context); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:14:20
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3078 Modified Files: rdmindex_main.c Log Message: Bug fixes after first serie of tests Index: rdmindex_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmindex_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rdmindex_main.c 2 Jan 2006 09:13:53 -0000 1.1 --- rdmindex_main.c 3 Jan 2006 04:14:11 -0000 1.2 *************** *** 44,47 **** --- 44,49 ---- static roadmap_db_model *RoadMapIndexModel; + static const char *RdmIndexName = "index.rdm"; + static int RdmIndexVerbose = 0; *************** *** 49,53 **** static int RdmIndexGrand = 0; static int RdmIndexRecursive = 0; ! static char *RdmIndexPath; static struct poptOption RdmIndexOptions[] = { --- 51,55 ---- static int RdmIndexGrand = 0; static int RdmIndexRecursive = 0; ! static char *RdmIndexPath = NULL; static struct poptOption RdmIndexOptions[] = { *************** *** 79,84 **** static void rdmindex_save (void) { ! buildmap_set_source ("index"); ! buildmap_db_open (RdmIndexPath, "index"); buildmap_dictionary_save (); --- 81,86 ---- static void rdmindex_save (void) { ! buildmap_set_source (RdmIndexName); ! buildmap_db_open (RdmIndexPath, RdmIndexName); buildmap_dictionary_save (); *************** *** 142,151 **** name = *cursor; ! if (strcmp (name, "index.rdm") == 0) continue; fullname = roadmap_path_join (path, name); buildmap_set_source (fullname); ! if (! RdmIndexSilent) buildmap_info ("scanning the map file..."); if (! roadmap_db_open (path, name, RoadMapIndexModel)) { --- 144,156 ---- name = *cursor; ! if (strcmp (name, RdmIndexName) == 0) continue; ! ! /* Compatibility with old versions. */ ! if (strcmp (name, "usdir.rdm") == 0) continue; fullname = roadmap_path_join (path, name); buildmap_set_source (fullname); ! if (! RdmIndexSilent) buildmap_info ("indexing..."); if (! roadmap_db_open (path, name, RoadMapIndexModel)) { *************** *** 257,265 **** const char **leftovers; - RdmIndexPath = strdup(roadmap_path_preferred("maps")); decoder = poptGetContext ("rdmindex", argc, argv, RdmIndexOptions, 0); - while (poptGetNextOpt(decoder) > 0) ; --- 262,268 ---- *************** *** 267,275 **** buildmap_index_initialize (RdmIndexPath); - RoadMapIndexModel = - roadmap_db_register - (RoadMapIndexModel, "string", &RoadMapDictionaryHandler); if (RdmIndexGrand) { --- 270,300 ---- + /* The index path is set to the one directory provided as a "smart" + * default that is assumed to match the intend in most cases. + */ + if ((RdmIndexPath == NULL) && (leftovers[0] != NULL)) { + if ((leftovers[1] == NULL) && roadmap_path_is_directory(leftovers[0])) { + RdmIndexPath = strdup(leftovers[0]); + } + } + + /* Nothing really fits: use the ultimate default. */ + + if (RdmIndexPath == NULL) { + RdmIndexPath = strdup(roadmap_path_preferred("maps")); /* default. */ + } + + /* Make sure we have a directory there. */ + + if (! roadmap_path_is_directory (RdmIndexPath)) { + if (roadmap_file_exists (RdmIndexPath)) { + buildmap_fatal (-1, "path %s is not a directory", RdmIndexPath); + } else { + buildmap_fatal (-1, "path %s does not exist", RdmIndexPath); + } + } + buildmap_index_initialize (RdmIndexPath); if (RdmIndexGrand) { *************** *** 289,298 **** RoadMapIndexModel = roadmap_db_register ! (RoadMapIndexModel, "square", &RoadMapSquareHandler); ! /* Unused at that time. RoadMapIndexModel = roadmap_db_register ! (RoadMapIndexModel, "zip", &RoadMapZipHandler); ! */ /* By default we scan the local directory. */ --- 314,325 ---- RoadMapIndexModel = roadmap_db_register ! (RoadMapIndexModel, "metadata", &RoadMapMetadataHandler); RoadMapIndexModel = roadmap_db_register ! (RoadMapIndexModel, "square", &RoadMapSquareHandler); ! // Unused at that time. ! // RoadMapIndexModel = ! // roadmap_db_register ! // (RoadMapIndexModel, "zip", &RoadMapZipHandler); /* By default we scan the local directory. */ *************** *** 305,312 **** if (leftovers == NULL || leftovers[0] == NULL) { ! poptPrintUsage (decoder, stderr, 0); return 1; } if (RdmIndexRecursive) { --- 332,344 ---- if (leftovers == NULL || leftovers[0] == NULL) { ! poptPrintUsage (decoder, stderr, 0); /* No argument? */ return 1; } + RoadMapIndexModel = + roadmap_db_register + (RoadMapIndexModel, "string", &RoadMapDictionaryHandler); + + if (RdmIndexRecursive) { *************** *** 327,330 **** --- 359,364 ---- } + buildmap_set_source (RdmIndexName); + buildmap_index_sort(); |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:13:38
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2995 Modified Files: buildmap_index.c Log Message: Bug fixes after first serie of tests Index: buildmap_index.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_index.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_index.c 2 Jan 2006 09:13:34 -0000 1.1 --- buildmap_index.c 3 Jan 2006 04:13:29 -0000 1.2 *************** *** 226,229 **** --- 226,233 ---- } + BuildMapCurrentAuthority = this_authority; + + roadmap_hash_add (AuthorityBySymbol, symbol, AuthorityCount); + return this_authority; } *************** *** 404,407 **** --- 408,413 ---- if (this_authority == NULL) { this_authority = buildmap_index_new_authority (authority_index); + } else { + BuildMapCurrentAuthority = this_authority; } *************** *** 451,454 **** --- 457,463 ---- void buildmap_index_set_map_edges (const RoadMapArea *edges) { + if (BuildMapCurrentTerritory == NULL) { + buildmap_fatal (0, "no current map"); + } buildmap_index_include_area (&(BuildMapCurrentTerritory->edges), edges); *************** *** 516,522 **** *p1 = 0; ! p1 = roadmap_path_parent (NULL, common); ! strcpy (common, p1); ! roadmap_path_free (p1); } --- 525,533 ---- *p1 = 0; ! if (p1 != common) { ! p1 = roadmap_path_parent (NULL, common); ! strcpy (common, p1); ! roadmap_path_free (p1); ! } } *************** *** 542,581 **** Territory[index / BUILDMAP_BLOCK] + (index % BUILDMAP_BLOCK); this_territory->pathname = roadmap_path_parent (NULL, this_territory->maps->filename); ! for (this_map = this_territory->maps->next; ! this_map != NULL; ! this_map = this_map->next) { ! buildmap_index_common_parent ! (this_territory->pathname, this_map->filename); ! } ! /* Remove the common part from the file names. */ ! length = strlen (this_territory->pathname); ! p = roadmap_path_skip_separator ! (this_territory->maps->filename + length); ! if (p == NULL) { ! buildmap_fatal ! (0, "invalid common path %s", this_territory->pathname); } - length = (int) (p - this_territory->maps->filename); ! if (length > 0) { ! for (this_map = this_territory->maps; ! this_map != NULL; ! this_map = this_map->next) { ! char *relative = this_map->filename + length; ! this_map->filename_index = ! buildmap_dictionary_add (MapFiles, relative, strlen(relative)); } } } /* Retrieve the path for each authority by finding the * common denominator among the child territories. --- 553,606 ---- Territory[index / BUILDMAP_BLOCK] + (index % BUILDMAP_BLOCK); + /* Find if there is any common path for all the maps. */ + this_territory->pathname = roadmap_path_parent (NULL, this_territory->maps->filename); ! if (strcmp (RoadMapPathCurrentDirectory, this_territory->pathname) == 0) { ! this_territory->pathname[0] = 0; ! } else { ! for (this_map = this_territory->maps->next; ! this_map != NULL; ! this_map = this_map->next) { ! buildmap_index_common_parent ! (this_territory->pathname, this_map->filename); ! } } ! /* Register the file names, skipping the common path we found. */ ! length = strlen (this_territory->pathname); ! if (length > 0) { ! ! p = roadmap_path_skip_separator ! (this_territory->maps->filename + length); ! if (p == NULL) { ! buildmap_fatal ! (0, "invalid common path %s in %s", ! this_territory->pathname, ! this_territory->maps->filename); } + /* Ajust the length to avoid the path separator sequence. */ + length = (int) (p - this_territory->maps->filename); + } + + for (this_map = this_territory->maps; + this_map != NULL; + this_map = this_map->next) { + + const char *relative = this_map->filename + length; + + this_map->filename_index = + buildmap_dictionary_add (MapFiles, relative, strlen(relative)); } } + /* Retrieve the path for each authority by finding the * common denominator among the child territories. *************** *** 590,601 **** if (this_authority->territories == NULL) continue; ! this_authority->pathname = strdup (this_authority->territories->pathname); ! for (this_territory = this_authority->territories->next; ! this_territory != NULL; ! this_territory = this_territory->next) { ! buildmap_index_common_parent ! (this_authority->pathname, this_territory->pathname); } --- 615,634 ---- if (this_authority->territories == NULL) continue; ! if (this_authority->territories->pathname[0] == 0) { ! this_authority->pathname = ""; ! } else { ! ! this_authority->pathname = ! strdup (this_authority->territories->pathname); ! ! for (this_territory = this_authority->territories->next; ! this_territory != NULL; ! this_territory = this_territory->next) { ! ! buildmap_index_common_parent ! (this_authority->pathname, this_territory->pathname); ! } } *************** *** 604,624 **** length = strlen (this_authority->pathname); ! p = roadmap_path_skip_separator ! (this_authority->territories->pathname + length); ! if (p == NULL) { ! buildmap_fatal ! (0, "invalid common path %s", this_authority->pathname); ! } ! length = (int) (p - this_authority->territories->pathname); ! if (length > 0) { ! for (this_territory = this_authority->territories; ! this_territory != NULL; ! this_territory = this_territory->next) { ! char *relative = this_territory->pathname + length; this_territory->pathname_index = buildmap_dictionary_add (MapFiles, relative, strlen(relative)); } } --- 637,663 ---- length = strlen (this_authority->pathname); ! for (this_territory = this_authority->territories; ! this_territory != NULL; ! this_territory = this_territory->next) { ! if (this_territory->pathname[length] != 0) { ! const char *relative = this_territory->pathname; ! ! if (length > 0) { ! relative = roadmap_path_skip_separator (relative + length); ! if (relative == NULL) { ! buildmap_fatal ! (0, "invalid common path %s in %s", ! this_authority->pathname, ! this_territory->pathname); ! } ! } this_territory->pathname_index = buildmap_dictionary_add (MapFiles, relative, strlen(relative)); + + } else { + this_territory->pathname_index = 0; } } *************** *** 770,773 **** --- 809,816 ---- void buildmap_index_summary (void) { + + fprintf (stderr, + "-- index statistics: %d authorities, %d territories, %d maps\n", + AuthorityCount, TerritoryCount, MapCount); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:12:38
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2715 Modified Files: roadmap_path.c Log Message: Detect when the file name contains no path and the current directory is returned as parent Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_path.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_path.c 2 Jan 2006 09:10:54 -0000 1.5 --- roadmap_path.c 3 Jan 2006 04:12:28 -0000 1.6 *************** *** 33,36 **** --- 33,38 ---- #include "../roadmap_path.h" + extern const char *RoadMapPathCurrentDirectory = "."; + typedef struct RoadMapPathRecord *RoadMapPathList; *************** *** 153,157 **** separator = strrchr (full_name, '\\'); if (separator == NULL) { ! return "."; } --- 155,160 ---- separator = strrchr (full_name, '\\'); if (separator == NULL) { ! roadmap_path_free (full_name); ! return strdup(RoadMapPathCurrentDirectory); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:12:20
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2620 Modified Files: roadmap_path.c Log Message: Detect when the file name contains no path and the current directory is returned as parent Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_path.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_path.c 2 Jan 2006 09:10:25 -0000 1.19 --- roadmap_path.c 3 Jan 2006 04:12:06 -0000 1.20 *************** *** 42,45 **** --- 42,47 ---- + const char *RoadMapPathCurrentDirectory = "."; + typedef struct RoadMapPathRecord *RoadMapPathList; *************** *** 210,214 **** separator = strrchr (full_name, '/'); if (separator == NULL) { ! return "."; } --- 212,217 ---- separator = strrchr (full_name, '/'); if (separator == NULL) { ! roadmap_path_free(full_name); ! return strdup(RoadMapPathCurrentDirectory); } *************** *** 542,546 **** void roadmap_path_free (const char *path) { ! free ((char *) path); } --- 545,551 ---- void roadmap_path_free (const char *path) { ! if (path != RoadMapPathCurrentDirectory) { ! free ((char *) path); ! } } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:11:40
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2476 Modified Files: roadmap_path.h Log Message: Detect when the file name contains no path and the current directory is returned as parent Index: roadmap_path.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_path.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_path.h 2 Jan 2006 09:10:14 -0000 1.10 --- roadmap_path.h 3 Jan 2006 04:11:32 -0000 1.11 *************** *** 27,31 **** * In addition this API is OS independent. * ! * The roadmap_path_user() function returns a constant that represents * the path of the RoadMap context for the current user (on UNIX, this * is typically $HOME/,roadmap). The roadmap_path_trips() function --- 27,31 ---- * In addition this API is OS independent. * ! * The function roadmap_path_user() returns a constant that represents * the path of the RoadMap context for the current user (on UNIX, this * is typically $HOME/,roadmap). The roadmap_path_trips() function *************** *** 35,39 **** * return the full path name of a single directory (i.e. not a list). * ! * The roadmap_path_set() function sets a current RoadMap directory search * list. If the search list was never set, the default path is used (see * above). When analyzing the path string, roadmap_path_set() expands --- 35,39 ---- * return the full path name of a single directory (i.e. not a list). * ! * The function roadmap_path_set() sets a current RoadMap directory search * list. If the search list was never set, the default path is used (see * above). When analyzing the path string, roadmap_path_set() expands *************** *** 66,70 **** * it returns the path of the parent directory of the concatenation result. * Both functions ignore the path argument if it is either NULL or empty. ! * Only the file name is considered in this case. * * For example, on UNIX, if path is "/usr/include" and name is "sys/errno.h" --- 66,73 ---- * it returns the path of the parent directory of the concatenation result. * Both functions ignore the path argument if it is either NULL or empty. ! * Only the file name is considered in this case. If the name provided to ! * roadmap_path_parent() does not contain any path (local file), then ! * roadmap_path_parent() must return a string identical to the value of ! * RoadMapPathCurrentDirectory. * * For example, on UNIX, if path is "/usr/include" and name is "sys/errno.h" *************** *** 107,110 **** --- 110,115 ---- #define INCLUDE__ROADMAP_PATH__H + extern const char *RoadMapPathCurrentDirectory; + void roadmap_path_set (const char *name, const char *path); |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:10:37
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2055 Modified Files: roadmap_metadata.h Log Message: Option to dump the attributes as a debug help Index: roadmap_metadata.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_metadata.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_metadata.h 2 Jan 2006 09:02:37 -0000 1.2 --- roadmap_metadata.h 3 Jan 2006 04:10:25 -0000 1.3 *************** *** 36,39 **** --- 36,45 ---- int index); + typedef void (*RoadMapMetadataIterator) (const char *category, + const char *name, + const char *value); + + void roadmap_metadata_scan_attributes (RoadMapMetadataIterator iterator); + extern roadmap_db_handler RoadMapMetadataHandler; |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:10:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2000 Modified Files: roadmap_metadata.c Log Message: Option to dump the attributes as a debug help Index: roadmap_metadata.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_metadata.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_metadata.c 2 Jan 2006 23:33:13 -0000 1.3 --- roadmap_metadata.c 3 Jan 2006 04:10:17 -0000 1.4 *************** *** 26,29 **** --- 26,34 ---- * const char *name); * + * const char *roadmap_metadata_get_attribute_next (const char *category, + * const char *name, + * int index); + * + * void roadmap_metadata_scan_attributes (RoadMapMetadataIterator iterator); */ *************** *** 52,56 **** int ValuesCount; ! RoadMapDictionary RoadMapAttributeStrings; } RoadMapMetadataContext; --- 57,61 ---- int ValuesCount; ! RoadMapDictionary strings; } RoadMapMetadataContext; *************** *** 73,77 **** } context->type = RoadMapMetadataType; ! context->RoadMapAttributeStrings = NULL; attributes_table = roadmap_db_get_subsection (root, "attributes"); --- 78,82 ---- } context->type = RoadMapMetadataType; ! context->strings = NULL; attributes_table = roadmap_db_get_subsection (root, "attributes"); *************** *** 115,125 **** } ! if (this->RoadMapAttributeStrings == NULL) { ! this->RoadMapAttributeStrings = ! roadmap_dictionary_open ("attributes"); ! } ! if (this->RoadMapAttributeStrings == NULL) { ! roadmap_log (ROADMAP_FATAL, "cannot open dictionary"); } } --- 120,129 ---- } ! if (this->strings == NULL) { ! this->strings = roadmap_dictionary_open ("attributes"); ! if (this->strings == NULL) { ! roadmap_log (ROADMAP_FATAL, "cannot open dictionary"); ! } } } *************** *** 168,177 **** coded_category = ! roadmap_dictionary_locate ! (RoadMapMetadataActive->RoadMapAttributeStrings, category); coded_name = ! roadmap_dictionary_locate ! (RoadMapMetadataActive->RoadMapAttributeStrings, name); for (i = RoadMapMetadataActive->AttributesCount - 1; i >= 0; --i) { --- 172,179 ---- coded_category = ! roadmap_dictionary_locate (RoadMapMetadataActive->strings, category); coded_name = ! roadmap_dictionary_locate (RoadMapMetadataActive->strings, name); for (i = RoadMapMetadataActive->AttributesCount - 1; i >= 0; --i) { *************** *** 187,191 **** } return roadmap_dictionary_get ! (RoadMapMetadataActive->RoadMapAttributeStrings, RoadMapMetadataActive->Values[cursor]); } --- 189,193 ---- } return roadmap_dictionary_get ! (RoadMapMetadataActive->strings, RoadMapMetadataActive->Values[cursor]); } *************** *** 195,196 **** --- 197,233 ---- } + + void roadmap_metadata_scan_attributes (RoadMapMetadataIterator iterator) { + + int i; + int j; + int value_end; + const char *category; + const char *name; + RoadMapAttribute *this_attribute; + + if (RoadMapMetadataActive == NULL) return; + + for (i = RoadMapMetadataActive->AttributesCount - 1; i >= 0; --i) { + + this_attribute = RoadMapMetadataActive->Attributes + i; + + category = + roadmap_dictionary_get (RoadMapMetadataActive->strings, + this_attribute->category); + + name = + roadmap_dictionary_get (RoadMapMetadataActive->strings, + this_attribute->name); + + value_end = this_attribute->value_first + this_attribute->value_count; + + for (j = this_attribute->value_first; j < value_end; ++j) { + iterator (category, + name, + roadmap_dictionary_get (RoadMapMetadataActive->strings, + RoadMapMetadataActive->Values[j])); + } + } + } + |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:07:56
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1039 Modified Files: dumpmap_main.c Log Message: Option to dump the attributes as a debug help Index: dumpmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/dumpmap_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dumpmap_main.c 2 Jan 2006 09:04:48 -0000 1.4 --- dumpmap_main.c 3 Jan 2006 04:07:48 -0000 1.5 *************** *** 30,39 **** #include "roadmap_dbread.h" #include "roadmap_dictionary.h" ! roadmap_db_model *RoadMapCountyModel = NULL; static int DumpMapVerbose = 0; static int DumpMapShowStrings = 0; static char *DumpMapShowDump = NULL; static char *DumpMapShowVolume = NULL; --- 30,41 ---- #include "roadmap_dbread.h" #include "roadmap_dictionary.h" + #include "roadmap_metadata.h" ! roadmap_db_model *RoadMapModel = NULL; static int DumpMapVerbose = 0; static int DumpMapShowStrings = 0; + static int DumpMapShowAttributes = 0; static char *DumpMapShowDump = NULL; static char *DumpMapShowVolume = NULL; *************** *** 209,212 **** --- 211,249 ---- + /* Attributes print module ------------------------------------------------- + * + * This is a simple module as it does not care about keeping any + * context, it does its jobs once the database has been mapped, and + * then it forgets about the database. + */ + + static void *dumpmap_attributes_map (roadmap_db *root) { + + return (*RoadMapMetadataHandler.map) (root); + } + + static void dumpmap_attributes_print (const char *category, + const char *name, + const char *value) { + + printf (" %s.%s: %s\n", category, name, value); + } + + static void dumpmap_attributes_activate (void *context) { + + (*RoadMapMetadataHandler.activate) (context); + + if (DumpMapShowAttributes != 0) { + roadmap_metadata_scan_attributes (dumpmap_attributes_print); + } else { + roadmap_dictionary_dump (); + } + } + + roadmap_db_handler DumpMapPrintAttributes = + {"attributes", + dumpmap_attributes_map, dumpmap_attributes_activate, NULL}; + + /* Section dump module ----------------------------------------------------- * *************** *** 252,255 **** --- 289,295 ---- POPT_ARG_STRING, &DumpMapShowDump, 0, "Dump a specific table", "TABLE"}, + {"attributes", 'a', + POPT_ARG_NONE, &DumpMapShowAttributes, 0, "Show map attributes", NULL}, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, DumpMapDictionaryOptions, 0, "Dictionary options", NULL}, *************** *** 261,264 **** --- 301,305 ---- int main (int argc, const char **argv) { + int i; const char **leftovers; *************** *** 271,299 **** ! if (DumpMapShowStrings || (DumpMapShowVolume != NULL)) { ! RoadMapCountyModel = roadmap_db_register ! (RoadMapCountyModel, "string", &DumpMapPrintString); } else if (DumpMapSearchStringOption != NULL) { ! RoadMapCountyModel = roadmap_db_register ! (RoadMapCountyModel, "string", &RoadMapDictionaryHandler); ! RoadMapCountyModel = roadmap_db_register ! (RoadMapCountyModel, "/", &DumpMapSearchString); } else if (DumpMapShowDump != NULL) { ! RoadMapCountyModel = roadmap_db_register ! (RoadMapCountyModel, DumpMapShowDump, &DumpMapHexaDump); } else { ! RoadMapCountyModel = ! roadmap_db_register (RoadMapCountyModel, "/", &DumpMapPrintTree); } --- 312,349 ---- ! if (DumpMapShowAttributes) { ! RoadMapModel = roadmap_db_register ! (RoadMapModel, "metadata", &DumpMapPrintAttributes); ! RoadMapModel = ! roadmap_db_register ! (RoadMapModel, "string", &RoadMapDictionaryHandler); ! ! } else if (DumpMapShowStrings || (DumpMapShowVolume != NULL)) { ! ! RoadMapModel = ! roadmap_db_register ! (RoadMapModel, "string", &DumpMapPrintString); } else if (DumpMapSearchStringOption != NULL) { ! RoadMapModel = roadmap_db_register ! (RoadMapModel, "string", &RoadMapDictionaryHandler); ! RoadMapModel = roadmap_db_register ! (RoadMapModel, "/", &DumpMapSearchString); } else if (DumpMapShowDump != NULL) { ! RoadMapModel = roadmap_db_register ! (RoadMapModel, DumpMapShowDump, &DumpMapHexaDump); } else { ! RoadMapModel = ! roadmap_db_register (RoadMapModel, "/", &DumpMapPrintTree); } *************** *** 308,321 **** ! while (*leftovers != NULL) { ! printf ("%s\n", *leftovers); ! if (! roadmap_db_open ("", *leftovers, RoadMapCountyModel)) { ! roadmap_log (ROADMAP_FATAL, "cannot open the map database"); } ! roadmap_db_close ("", *leftovers); ! ! leftovers += 1; } --- 358,370 ---- ! for (i = 0; leftovers[i] != NULL; ++i) { ! if (leftovers[1] != NULL) printf ("%s\n", leftovers[i]); ! if (! roadmap_db_open ("", leftovers[i], RoadMapModel)) { ! roadmap_log (ROADMAP_FATAL, ! "cannot open map database %s", leftovers[i]); } ! roadmap_db_close ("", leftovers[i]); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:05:51
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv671 Modified Files: buildmap_messages.c Log Message: More meaningful messages when there is no source information Index: buildmap_messages.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_messages.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_messages.c 6 Mar 2005 20:41:26 -0000 1.2 --- buildmap_messages.c 3 Jan 2006 04:05:42 -0000 1.3 *************** *** 51,61 **** static int ErrorCount = 0; static int ErrorTotal = 0; - static int LastProgress = 0; ! void buildmap_set_source (char *name) { ! char *p; /* Get the file's base name (for error display purpose). */ --- 51,60 ---- static int ErrorCount = 0; static int ErrorTotal = 0; static int LastProgress = 0; ! void buildmap_set_source (const char *name) { ! const char *p; /* Get the file's base name (for error display purpose). */ *************** *** 84,99 **** ! void buildmap_error (int column, char *format, ...) { va_list ap; FILE *log; ! fprintf (stderr, "** %s, line %d, column %d: ", ! SourceFile, SourceLine, column+1); log = fopen ("buildmap_errors.log", "a"); if (log != NULL) { ! fprintf (log, "** %s, line %d, column %d: ", ! SourceFile, SourceLine, column+1); } --- 83,115 ---- ! static void buildmap_show_source (FILE *output, ! const char *preamble, int column) { ! ! if (SourceFile == NULL) { ! fprintf (output, "%s ", preamble); ! } else if (SourceLine > 0) { ! if (column >= 0) { ! fprintf (output, "%s %s, line %d, column %d: ", ! preamble, SourceFile, SourceLine, column+1); ! } else { ! fprintf (output, "%s %s, line %d: ", ! preamble, SourceFile, SourceLine); ! } ! } else { ! fprintf (output, "%s %s: ", preamble, SourceFile); ! } ! } ! ! ! void buildmap_error (int column, const char *format, ...) { va_list ap; FILE *log; ! buildmap_show_source (stderr, "**", column); log = fopen ("buildmap_errors.log", "a"); if (log != NULL) { ! buildmap_show_source (log, "**", column); } *************** *** 116,131 **** ! void buildmap_fatal (int column, char *format, ...) { va_list ap; FILE *log; ! fprintf (stderr, "## %s, line %d, column %d: ", ! SourceFile, SourceLine, column+1); log = fopen ("buildmap_errors.log", "a"); if (log != NULL) { ! fprintf (log, "## %s, line %d, column %d: ", ! SourceFile, SourceLine, column+1); } --- 132,145 ---- ! void buildmap_fatal (int column, const char *format, ...) { va_list ap; FILE *log; ! buildmap_show_source (stderr, "##", column); log = fopen ("buildmap_errors.log", "a"); if (log != NULL) { ! buildmap_show_source (log, "##", column); } *************** *** 160,172 **** ! void buildmap_info (char *format, ...) { va_list ap; ! if (SourceLine > 0) { ! fprintf (stderr, "-- %s, line %d: ", SourceFile, SourceLine); ! } else { ! fprintf (stderr, "-- %s: ", SourceFile); ! } va_start(ap, format); --- 174,182 ---- ! void buildmap_info (const char *format, ...) { va_list ap; ! buildmap_show_source (stderr, "--", -1); va_start(ap, format); *************** *** 178,195 **** ! void buildmap_summary (int verbose, char *format, ...) { va_list ap; if (ErrorCount > 0) { if (ErrorCount > 1) { ! fprintf (stderr, "-- %s: %d errors", SourceFile, ErrorCount); } else { ! fprintf (stderr, "-- %s: 1 error", SourceFile); } verbose = 1; ErrorCount = 0; } else if (verbose) { ! fprintf (stderr, "-- %s: %d lines, no error", SourceFile, SourceLine); } --- 188,208 ---- ! void buildmap_summary (int verbose, const char *format, ...) { va_list ap; + SourceLine = 0; + buildmap_show_source (stderr, "--", -1); + if (ErrorCount > 0) { if (ErrorCount > 1) { ! fprintf (stderr, "%d errors", ErrorCount); } else { ! fprintf (stderr, "1 error"); } verbose = 1; ErrorCount = 0; } else if (verbose) { ! fprintf (stderr, "no error"); } |
From: Pascal F M. <pas...@us...> - 2006-01-03 04:05:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv520 Modified Files: buildmap.h Log Message: More meaningful messages when there is no source information Index: buildmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap.h 14 Nov 2005 06:58:19 -0000 1.2 --- buildmap.h 3 Jan 2006 04:05:15 -0000 1.3 *************** *** 31,42 **** ! void buildmap_set_source (char *name); void buildmap_set_line (int line); ! void buildmap_fatal (int column, char *format, ...); ! void buildmap_error (int column, char *format, ...); void buildmap_progress (int done, int estimated); ! void buildmap_info (char *format, ...); ! void buildmap_summary (int verbose, char *format, ...); int buildmap_get_error_count (void); --- 31,42 ---- ! void buildmap_set_source (const char *name); void buildmap_set_line (int line); ! void buildmap_fatal (int column, const char *format, ...); ! void buildmap_error (int column, const char *format, ...); void buildmap_progress (int done, int estimated); ! void buildmap_info (const char *format, ...); ! void buildmap_summary (int verbose, const char *format, ...); int buildmap_get_error_count (void); |
From: Pascal F M. <pas...@us...> - 2006-01-02 23:33:22
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8107 Modified Files: roadmap_metadata.c Log Message: Don't crash if the metadata table is not there Index: roadmap_metadata.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_metadata.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_metadata.c 2 Jan 2006 09:03:12 -0000 1.2 --- roadmap_metadata.c 2 Jan 2006 23:33:13 -0000 1.3 *************** *** 161,169 **** int i; ! RoadMapString coded_category = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, category); ! RoadMapString coded_name = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, name); --- 161,175 ---- int i; ! RoadMapString coded_category; ! RoadMapString coded_name; ! ! ! if (RoadMapMetadataActive == NULL) return ""; ! ! coded_category = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, category); ! coded_name = roadmap_dictionary_locate (RoadMapMetadataActive->RoadMapAttributeStrings, name); |
From: Pascal F M. <pas...@us...> - 2006-01-02 23:32:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7913 Modified Files: buildus_main.c Log Message: The new roadmap_db_open() needs the complete file name Index: buildus_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildus_main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildus_main.c 2 Jan 2006 09:05:14 -0000 1.10 --- buildus_main.c 2 Jan 2006 23:32:21 -0000 1.11 *************** *** 75,82 **** static void buildus_save (void) { ! buildmap_set_source ("usdir"); ! if (buildmap_db_open (BuildMapPath, "usdir") < 0) { ! buildmap_fatal (0, "cannot create database 'usdir'"); } --- 75,82 ---- static void buildus_save (void) { ! buildmap_set_source ("usdir.rdm"); ! if (buildmap_db_open (BuildMapPath, "usdir.rdm") < 0) { ! buildmap_fatal (0, "cannot create database 'usdir.rdm'"); } |
From: Pascal F M. <pas...@us...> - 2006-01-02 23:31:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7602 Modified Files: buildmap_main.c Log Message: roadmap_db_open() does not scan the search path anymore, it opens the specified file Index: buildmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_main.c 14 Nov 2005 07:00:20 -0000 1.7 --- buildmap_main.c 2 Jan 2006 23:31:16 -0000 1.8 *************** *** 180,194 **** static void buildmap_county_save (const char *name) { - char *cursor; char db_name[128]; ! snprintf (db_name, 127, "usc%s", name); ! ! /* Remove the suffix if any was provided. */ - cursor = strrchr (db_name, '.'); - if (cursor != NULL) { - *cursor = 0; - } if (buildmap_db_open (BuildMapResult, db_name) < 0) { --- 180,187 ---- static void buildmap_county_save (const char *name) { char db_name[128]; ! snprintf (db_name, 127, "usc%s.rdm", name); if (buildmap_db_open (BuildMapResult, db_name) < 0) { |
From: Pascal F M. <pas...@us...> - 2006-01-02 17:55:07
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15688 Modified Files: rdmdownload Log Message: Support for TIGER 2005 first edition Index: rdmdownload =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/rdmdownload,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rdmdownload 4 Sep 2005 21:05:12 -0000 1.3 --- rdmdownload 2 Jan 2006 17:54:55 -0000 1.4 *************** *** 7,13 **** # ------ # ! # rdmdownload <destination-path> [format=2000|2002|2004] [<state-symbol> ..] # ! # Example: downloadmap /var/tmp/maps CA # # PLEASE NOTE THE TIGER FILES ARE HUGE: THIS DOWNLOAD IS LIKELY --- 7,13 ---- # ------ # ! # rdmdownload <destination-path> [format=2004|2005] [<state> ..] # ! # Example: rdmdownload /var/tmp/maps CA # # PLEASE NOTE THE TIGER FILES ARE HUGE: THIS DOWNLOAD IS LIKELY *************** *** 20,35 **** shift ! TIGERURL=http://www2.census.gov/geo/tiger/tiger2004se TIGEROPT1="-nd -np -r -N -P $TIGERDIR -A.zip" TIGEROPT2="-nd -np -r -N -P $TIGERDIR -A.ZIP" case $1 in ! format=2000) TIGERURL=http://www2.census.gov/geo/tiger/tigerua ! shift ! ;; ! format=2002) TIGERURL=http://www2.census.gov/geo/tiger/tiger2002 shift ;; ! format=2004) shift ;; --- 20,32 ---- shift ! TIGERURL=http://www2.census.gov/geo/tiger/tiger2005fe TIGEROPT1="-nd -np -r -N -P $TIGERDIR -A.zip" TIGEROPT2="-nd -np -r -N -P $TIGERDIR -A.ZIP" case $1 in ! format=2004) TIGERURL=http://www2.census.gov/geo/tiger/tiger2004se shift ;; ! format=2005) shift ;; |