diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-11-03 17:32:14 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-11-03 17:32:14 +0000 |
commit | 2956b0b9d95ccc13b49e742c3ea36b01f92265c9 (patch) | |
tree | 5447d0857c6f9399cfb63386d7d9eef9ca55aed3 /navit/map.c | |
parent | 082f0a70cb2de44169e0ebd3bc09a708aaa997c4 (diff) | |
download | navit-2956b0b9d95ccc13b49e742c3ea36b01f92265c9.tar.gz |
Fix:Core:Fixed and cleaned up navigation
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1630 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map.c')
-rw-r--r-- | navit/map.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/navit/map.c b/navit/map.c index 482665db5..d36e0de82 100644 --- a/navit/map.c +++ b/navit/map.c @@ -579,7 +579,7 @@ map_priv_is(struct map *map, struct map_priv *priv) } void -map_dump(struct map *map) +map_dump_filedesc(struct map *map, FILE *out) { struct map_rect *mr=map_rect_new(map, NULL); struct item *item; @@ -590,14 +590,29 @@ map_dump(struct map *map) while ((item = map_rect_get_item(mr))) { count=item_coord_get(item, ca, item->type < type_line ? 1: max); if (item->type < type_line) - printf("mg:0x%x 0x%x ", ca[0].x, ca[0].y); - printf("%s", item_to_name(item->type)); + fprintf(out,"mg:0x%x 0x%x ", ca[0].x, ca[0].y); + fprintf(out,"%s", item_to_name(item->type)); while (item_attr_get(item, attr_any, &attr)) - printf(" %s='%s'", attr_to_name(attr.type), attr_to_text(&attr, map, 1)); - printf("\n"); + fprintf(out," %s='%s'", attr_to_name(attr.type), attr_to_text(&attr, map, 1)); + fprintf(out,"\n"); if (item->type >= type_line) for (i = 0 ; i < count ; i++) - printf("mg:0x%x 0x%x\n", ca[i].x, ca[i].y); + fprintf(out,"mg:0x%x 0x%x\n", ca[i].x, ca[i].y); } map_rect_destroy(mr); } + +void +map_dump_file(struct map *map, char *file) +{ + FILE *f; + f=fopen(file,"w"); + map_dump_filedesc(map, f); + fclose(f); +} + +void +map_dump(struct map *map) +{ + map_dump_filedesc(map, stdout); +} |