Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/ways.h
Parent Directory
|
Revision Log
Revision 98 -
(show annotations)
(download)
(as text)
Mon Feb 2 18:53:13 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 2396 byte(s)
Mon Feb 2 18:53:13 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 2396 byte(s)
More variable and function name changes.
1 | /*************************************** |
2 | $Header: /home/amb/CVS/routino/src/ways.h,v 1.22 2009-02-02 18:53:13 amb Exp $ |
3 | |
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 | #include "ways.h" |
21 | |
22 | |
23 | /* Data structures */ |
24 | |
25 | |
26 | /*+ An extended structure containing a single way. +*/ |
27 | typedef struct _WayX |
28 | { |
29 | index_t index; /*+ The index of the way. +*/ |
30 | char *name; /*+ The name of the way. +*/ |
31 | |
32 | Way way; /*+ The real Way data. +*/ |
33 | } |
34 | WayX; |
35 | |
36 | /*+ A structure containing a set of ways (mmap format). +*/ |
37 | typedef struct _Ways |
38 | { |
39 | uint32_t number; /*+ How many entries are used? +*/ |
40 | |
41 | Way *ways; /*+ An array of ways. */ |
42 | char *names; /*+ An array of characters containing the names. +*/ |
43 | |
44 | void *data; /*+ The memory mapped data. +*/ |
45 | } |
46 | Ways; |
47 | |
48 | /*+ A structure containing a set of ways (memory format). +*/ |
49 | typedef struct _WaysX |
50 | { |
51 | uint32_t sorted; /*+ Is the data sorted? +*/ |
52 | uint32_t alloced; /*+ How many entries are allocated? +*/ |
53 | uint32_t number; /*+ How many entries are used? +*/ |
54 | uint32_t length; /*+ How long is the string of name entries? +*/ |
55 | |
56 | WayX *xdata; /*+ The extended data for the Ways. +*/ |
57 | char *names; /*+ The array containing all the names. +*/ |
58 | } |
59 | WaysX; |
60 | |
61 | |
62 | /* Functions */ |
63 | |
64 | |
65 | WaysX *NewWayList(void); |
66 | |
67 | Ways *LoadWayList(const char *filename); |
68 | void SaveWayList(WaysX *waysx,const char *filename); |
69 | |
70 | Way *AppendWay(WaysX* waysx,const char *name); |
71 | |
72 | void SortWayList(WaysX *waysx); |
73 | |
74 | Highway HighwayType(const char *highway); |
75 | Transport TransportType(const char *transport); |
76 | |
77 | const char *HighwayName(Highway highway); |
78 | const char *TransportName(Transport transport); |
79 | |
80 | const char *HighwayList(void); |
81 | const char *TransportList(void); |
82 | |
83 | #define LookupWayX(xxx,yyy) (&(xxx)->xdata[yyy]) |
84 | |
85 | #define IndexWayX(xxx,yyy) ((yyy)-&(xxx)->xdata[0]) |
86 | |
87 | |
88 | #endif /* WAYS_H */ |
Properties
Name | Value |
---|---|
cvs:description | Header file for ways. |