Routino SVN Repository Browser

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

ViewVC logotype

Annotation of /trunk/src/filedumper.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65 - (hide annotations) (download) (as text)
Thu Jan 22 18:57:16 2009 UTC (16 years, 2 months ago) by amb
File MIME type: text/x-csrc
File size: 2901 byte(s)
Remove the choice of indexed or non-indexed data structures.

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

Properties

Name Value
cvs:description Test program for mmap files.