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/ways.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 135 - (hide annotations) (download) (as text)
Sun Mar 1 17:24:22 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 2337 byte(s)
Added more limits (weight, height, width, length).

1 amb 21 /***************************************
2 amb 135 $Header: /home/amb/CVS/routino/src/ways.h,v 1.25 2009-03-01 17:24:22 amb Exp $
3 amb 21
4     A header file for the ways.
5     ******************/ /******************
6     Written by Andrew M. Bishop
7    
8     This file Copyright 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     #ifndef WAYS_H
16     #define WAYS_H /*+ To stop multiple inclusions. +*/
17    
18     #include <stdint.h>
19    
20 amb 109 #include "types.h"
21 amb 21
22    
23     /* Data structures */
24    
25    
26 amb 109 /*+ A structure containing a single way. +*/
27     struct _Way
28 amb 87 {
29 amb 109 index_t name; /*+ The offset of the name of the way in the names array. +*/
30 amb 87
31 amb 109 waytype_t type; /*+ The type of the way. +*/
32    
33     wayallow_t allow; /*+ The type of traffic allowed on the way. +*/
34 amb 135
35     speed_t speed; /*+ The defined maximum speed limit of the way. +*/
36    
37     weight_t weight; /*+ The defined maximum weight of traffic on the way. +*/
38     height_t height; /*+ The defined maximum height of traffic on the way. +*/
39     width_t width; /*+ The defined maximum width of traffic on the way. +*/
40     length_t length; /*+ The defined maximum length of traffic on the way. +*/
41 amb 109 };
42    
43    
44 amb 21 /*+ A structure containing a set of ways (mmap format). +*/
45 amb 109 struct _Ways
46 amb 21 {
47 amb 87 uint32_t number; /*+ How many entries are used? +*/
48    
49     Way *ways; /*+ An array of ways. */
50     char *names; /*+ An array of characters containing the names. +*/
51    
52     void *data; /*+ The memory mapped data. +*/
53 amb 109 };
54 amb 21
55    
56 amb 109 /* Macros */
57 amb 21
58    
59 amb 109 /*+ Return a Way* pointer given a set of ways and an index. +*/
60     #define LookupWay(xxx,yyy) (&(xxx)->ways[yyy])
61 amb 21
62 amb 109 /*+ Return the name of a way given the Way pointer and a set of ways. +*/
63     #define WayName(xxx,yyy) (&(xxx)->names[(yyy)->name])
64 amb 21
65    
66 amb 109 /* Functions */
67 amb 21
68    
69 amb 109 Ways *LoadWayList(const char *filename);
70 amb 21
71 amb 74 Highway HighwayType(const char *highway);
72     Transport TransportType(const char *transport);
73 amb 21
74 amb 82 const char *HighwayName(Highway highway);
75     const char *TransportName(Transport transport);
76    
77 amb 75 const char *HighwayList(void);
78     const char *TransportList(void);
79    
80 amb 32
81 amb 21 #endif /* WAYS_H */

Properties

Name Value
cvs:description Header file for ways.