Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/waysx.h
Parent Directory
|
Revision Log
Revision 181 -
(hide annotations)
(download)
(as text)
Sun May 31 12:30:12 2009 UTC (15 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2278 byte(s)
Sun May 31 12:30:12 2009 UTC (15 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2278 byte(s)
Move function from waysx.c to ways.c.
1 | amb | 110 | /*************************************** |
2 | amb | 181 | $Header: /home/amb/CVS/routino/src/waysx.h,v 1.4 2009-05-31 12:30:12 amb Exp $ |
3 | amb | 110 | |
4 | A header file for the extended Ways structure. | ||
5 | amb | 151 | |
6 | Part of the Routino routing software. | ||
7 | amb | 110 | ******************/ /****************** |
8 | amb | 151 | This file Copyright 2008,2009 Andrew M. Bishop |
9 | amb | 110 | |
10 | amb | 151 | This program is free software: you can redistribute it and/or modify |
11 | it under the terms of the GNU Affero General Public License as published by | ||
12 | the Free Software Foundation, either version 3 of the License, or | ||
13 | (at your option) any later version. | ||
14 | |||
15 | This program is distributed in the hope that it will be useful, | ||
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | GNU Affero General Public License for more details. | ||
19 | |||
20 | You should have received a copy of the GNU Affero General Public License | ||
21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | amb | 110 | ***************************************/ |
23 | |||
24 | |||
25 | #ifndef WAYSX_H | ||
26 | #define WAYSX_H /*+ To stop multiple inclusions. +*/ | ||
27 | |||
28 | #include <stdint.h> | ||
29 | |||
30 | #include "types.h" | ||
31 | #include "ways.h" | ||
32 | |||
33 | |||
34 | /* Data structures */ | ||
35 | |||
36 | |||
37 | /*+ An extended structure containing a single way. +*/ | ||
38 | struct _WayX | ||
39 | { | ||
40 | char *name; /*+ The name of the way. +*/ | ||
41 | |||
42 | Way way; /*+ The real Way data. +*/ | ||
43 | }; | ||
44 | |||
45 | |||
46 | /*+ A structure containing a set of ways (memory format). +*/ | ||
47 | struct _WaysX | ||
48 | { | ||
49 | uint32_t sorted; /*+ Is the data sorted? +*/ | ||
50 | uint32_t alloced; /*+ How many entries are allocated? +*/ | ||
51 | uint32_t number; /*+ How many entries are used? +*/ | ||
52 | uint32_t length; /*+ How long is the string of name entries? +*/ | ||
53 | |||
54 | WayX *idata; /*+ The extended data for the Ways (sorted by index). +*/ | ||
55 | WayX **ndata; /*+ The extended data for the Ways (sorted by name). +*/ | ||
56 | char *names; /*+ The array containing all the names. +*/ | ||
57 | }; | ||
58 | |||
59 | |||
60 | /* Macros */ | ||
61 | |||
62 | |||
63 | #define LookupWayX(xxx,yyy) (&(xxx)->idata[yyy]) | ||
64 | |||
65 | #define IndexWayX(xxx,yyy) ((yyy)-&(xxx)->idata[0]) | ||
66 | |||
67 | |||
68 | /* Functions */ | ||
69 | |||
70 | |||
71 | WaysX *NewWayList(void); | ||
72 | |||
73 | void SaveWayList(WaysX *waysx,const char *filename); | ||
74 | |||
75 | Way *AppendWay(WaysX* waysx,const char *name); | ||
76 | |||
77 | void SortWayList(WaysX *waysx); | ||
78 | |||
79 | #endif /* WAYSX_H */ |
Properties
Name | Value |
---|---|
cvs:description | Extended ways header. |