Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/filedumper.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 109 - (show annotations) (download) (as text)
Sat Feb 7 15:56:08 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-csrc
File size: 2558 byte(s)
Split the extended data types from the normal data types.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/filedumper.c,v 1.18 2009-02-07 15:56:07 amb Exp $
3
4 Memory file dumper.
5 ******************/ /******************
6 Written by Andrew M. Bishop
7
8 This file Copyright 2008,2009 Andrew M. Bishop
9 It may be distributed under the GNU Public License, version 2, or
10 any higher version. See section COPYING of the GNU Public license
11 for conditions under which this file may be redistributed.
12 ***************************************/
13
14
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18
19 #include "types.h"
20 #include "nodes.h"
21 #include "segments.h"
22 #include "ways.h"
23
24
25 int main(int argc,char** argv)
26 {
27 Nodes *OSMNodes;
28 Segments *OSMSegments;
29 Ways *OSMWays;
30 char *dirname=NULL,*prefix=NULL,*filename;
31
32 /* Parse the command line arguments */
33
34 while(--argc>=1)
35 {
36 if(!strcmp(argv[argc],"--help"))
37 goto usage;
38 else if(!strncmp(argv[argc],"--dir=",6))
39 dirname=&argv[argc][6];
40 else if(!strncmp(argv[argc],"--prefix=",9))
41 prefix=&argv[argc][9];
42 else
43 {
44 usage:
45
46 fprintf(stderr,"Usage: filedumper\n"
47 " [--help]\n"
48 " [--dir=<name>] [--prefix=<name>]\n");
49
50 return(1);
51 }
52 }
53
54 filename=(char*)malloc((dirname?strlen(dirname):0)+(prefix?strlen(prefix):0)+16);
55
56 /* Examine the nodes */
57
58 sprintf(filename,"%s%s%s%snodes.mem",dirname?dirname:"",dirname?"/":"",prefix?prefix:"",prefix?"-":"");
59 OSMNodes=LoadNodeList(filename);
60
61 printf("Nodes\n");
62 printf("-----\n");
63
64 printf("sizeof(Node)=%9d Bytes\n",sizeof(Node));
65 printf("number =%9d\n",OSMNodes->number);
66
67 printf("Lat bins=%3d\n",OSMNodes->latbins);
68 printf("Lon bins=%3d\n",OSMNodes->lonbins);
69
70 printf("Lat zero=%4.6f\n",OSMNodes->latzero);
71 printf("Lon zero=%4.6f\n",OSMNodes->lonzero);
72
73 /* Examine the segments */
74
75 sprintf(filename,"%s%s%s%ssegments.mem",dirname?dirname:"",dirname?"/":"",prefix?prefix:"",prefix?"-":"");
76 OSMSegments=LoadSegmentList(filename);
77
78 printf("\n");
79 printf("Segments\n");
80 printf("--------\n");
81
82 printf("sizeof(Segment)=%9d Bytes\n",sizeof(Segment));
83 printf("number =%9d\n",OSMSegments->number);
84
85 /* Examine the ways */
86
87 sprintf(filename,"%s%s%s%sways.mem",dirname?dirname:"",dirname?"/":"",prefix?prefix:"",prefix?"-":"");
88 OSMWays=LoadWayList(filename);
89
90 printf("\n");
91 printf("Ways\n");
92 printf("----\n");
93
94 printf("sizeof(Way) =%9d Bytes\n",sizeof(Way));
95 printf("number =%9d\n",OSMWays->number);
96
97 return(0);
98 }

Properties

Name Value
cvs:description Test program for mmap files.