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 66 - (show annotations) (download) (as text)
Thu Jan 22 19:15:30 2009 UTC (16 years, 2 months ago) by amb
File MIME type: text/x-csrc
File size: 2901 byte(s)
Nodes, Segments, Ways - Nodes, Segments, Ways.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/filedumper.c,v 1.13 2009-01-22 19:15:30 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
18 #include "functions.h"
19
20
21 int main(int argc,char** argv)
22 {
23 Nodes *OSMNodes;
24 Segments *OSMSegments;
25 Ways *OSMWays;
26 Nodes *SuperNodes;
27 Segments *SuperSegments;
28 Ways *SuperWays;
29
30 /* Examine the nodes */
31
32 OSMNodes=LoadNodeList("data/nodes.mem");
33
34 printf("Nodes\n");
35 printf("-----\n");
36
37 printf("sizeof(Node)=%9d Bytes\n",sizeof(Node));
38 printf("number =%9d\n",OSMNodes->number);
39 printf("total size =%9d Bytes\n",sizeof(OSMNodes)-sizeof(OSMNodes->nodes)+OSMNodes->number*sizeof(Node));
40
41 /* Examine the segments */
42
43 OSMSegments=LoadSegmentList("data/segments.mem");
44
45 printf("\n");
46 printf("Segments\n");
47 printf("--------\n");
48
49 printf("sizeof(Segment)=%9d Bytes\n",sizeof(Segment));
50 printf("number =%9d\n",OSMSegments->number);
51 printf("total size =%9d Bytes\n",sizeof(OSMSegments)-sizeof(OSMSegments->segments)+OSMSegments->number*sizeof(Segment));
52
53 /* Examine the ways */
54
55 OSMWays=LoadWayList("data/ways.mem");
56
57 printf("\n");
58 printf("Ways\n");
59 printf("----\n");
60
61 printf("sizeof(Way) =%9d Bytes\n",sizeof(Way));
62 printf("number =%9d\n",OSMWays->number);
63 printf("total size =%9d Bytes\n",sizeof(OSMWays)-sizeof(OSMWays->ways)+OSMWays->number*sizeof(Way));
64
65 /* Examine the super-nodes */
66
67 SuperNodes=LoadNodeList("data/super-nodes.mem");
68
69 printf("\n");
70 printf("SuperNodes\n");
71 printf("----------\n");
72
73 printf("sizeof(Node)=%9d Bytes\n",sizeof(Node));
74 printf("number =%9d\n",SuperNodes->number);
75 printf("total size =%9d Bytes\n",sizeof(SuperNodes)-sizeof(SuperNodes->nodes)+SuperNodes->number*sizeof(Node));
76
77 /* Examine the super-segments */
78
79 SuperSegments=LoadSegmentList("data/super-segments.mem");
80
81 printf("\n");
82 printf("SuperSegments\n");
83 printf("-------------\n");
84
85 printf("sizeof(Segment)=%9d Bytes\n",sizeof(Segment));
86 printf("number =%9d\n",SuperSegments->number);
87 printf("total size =%9d Bytes\n",sizeof(SuperSegments)-sizeof(SuperSegments->segments)+SuperSegments->number*sizeof(Segment));
88
89 /* Examine the super-ways */
90
91 SuperWays=LoadWayList("data/super-ways.mem");
92
93 printf("\n");
94 printf("Super-Ways\n");
95 printf("----------\n");
96
97 printf("sizeof(Way) =%9d Bytes\n",sizeof(Way));
98 printf("number =%9d\n",SuperWays->number);
99 printf("total size =%9d Bytes\n",sizeof(SuperWays)-sizeof(SuperWays->ways)+SuperWays->number*sizeof(Way));
100
101 return(0);
102 }

Properties

Name Value
cvs:description Test program for mmap files.