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 134 -
(hide annotations)
(download)
(as text)
Sun Mar 1 17:23:30 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 1850 byte(s)
Sun Mar 1 17:23:30 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 1850 byte(s)
Added a function to test if two ways are the same.
1 | amb | 110 | /*************************************** |
2 | amb | 134 | $Header: /home/amb/CVS/routino/src/waysx.h,v 1.2 2009-03-01 17:23:30 amb Exp $ |
3 | amb | 110 | |
4 | A header file for the extended Ways structure. | ||
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 WAYSX_H | ||
16 | #define WAYSX_H /*+ To stop multiple inclusions. +*/ | ||
17 | |||
18 | #include <stdint.h> | ||
19 | |||
20 | #include "types.h" | ||
21 | #include "ways.h" | ||
22 | |||
23 | |||
24 | /* Data structures */ | ||
25 | |||
26 | |||
27 | /*+ An extended structure containing a single way. +*/ | ||
28 | struct _WayX | ||
29 | { | ||
30 | char *name; /*+ The name of the way. +*/ | ||
31 | |||
32 | Way way; /*+ The real Way data. +*/ | ||
33 | }; | ||
34 | |||
35 | |||
36 | /*+ A structure containing a set of ways (memory format). +*/ | ||
37 | struct _WaysX | ||
38 | { | ||
39 | uint32_t sorted; /*+ Is the data sorted? +*/ | ||
40 | uint32_t alloced; /*+ How many entries are allocated? +*/ | ||
41 | uint32_t number; /*+ How many entries are used? +*/ | ||
42 | uint32_t length; /*+ How long is the string of name entries? +*/ | ||
43 | |||
44 | WayX *idata; /*+ The extended data for the Ways (sorted by index). +*/ | ||
45 | WayX **ndata; /*+ The extended data for the Ways (sorted by name). +*/ | ||
46 | char *names; /*+ The array containing all the names. +*/ | ||
47 | }; | ||
48 | |||
49 | |||
50 | /* Macros */ | ||
51 | |||
52 | |||
53 | #define LookupWayX(xxx,yyy) (&(xxx)->idata[yyy]) | ||
54 | |||
55 | #define IndexWayX(xxx,yyy) ((yyy)-&(xxx)->idata[0]) | ||
56 | |||
57 | |||
58 | /* Functions */ | ||
59 | |||
60 | |||
61 | WaysX *NewWayList(void); | ||
62 | |||
63 | void SaveWayList(WaysX *waysx,const char *filename); | ||
64 | |||
65 | Way *AppendWay(WaysX* waysx,const char *name); | ||
66 | |||
67 | void SortWayList(WaysX *waysx); | ||
68 | |||
69 | amb | 134 | int WaysSame(Way *way1,Way *way2); |
70 | amb | 110 | |
71 | #endif /* WAYSX_H */ |
Properties
Name | Value |
---|---|
cvs:description | Extended ways header. |