1 /***************************************
2 $Header: /home/amb/routino/src/RCS/functions.h,v 1.58 2010/09/25 13:54:18 amb Exp $
4 Header file for function prototypes
6 Part of the Routino routing software.
7 ******************/ /******************
8 This file Copyright 2008-2010 Andrew M. Bishop
10 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.
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.
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 ***************************************/
26 #define FUNCTIONS_H /*+ To stop multiple inclusions. +*/
34 /*+ The number of waypoints allowed to be specified. +*/
40 /*+ Return true if this is a fake node. +*/
41 #define IsFakeNode(xxx) ((xxx)>=NODE_FAKE)
43 /*+ Return true if this is a fake segment. +*/
44 #define IsFakeSegment(xxx) ((xxx)>=SEGMENT_FAKE)
46 index_t CreateFakes(Nodes *nodes,int point,Segment *segment,index_t node1,index_t node2,distance_t dist1,distance_t dist2);
48 void GetFakeLatLong(index_t node, double *latitude,double *longitude);
50 Segment *FirstFakeSegment(index_t node);
51 Segment *NextFakeSegment(Segment *segment,index_t node);
52 Segment *ExtraFakeSegment(index_t node,index_t fakenode);
54 Segment *LookupFakeSegment(index_t index);
55 index_t IndexFakeSegment(Segment *segment);
60 Results *FindNormalRoute(Nodes *nodes,Segments *segments,Ways *ways,index_t start,index_t finish,Profile *profile);
61 Results *FindMiddleRoute(Nodes *supernodes,Segments *supersegments,Ways *superways,Results *begin,Results *end,Profile *profile);
63 Results *FindStartRoutes(Nodes *nodes,Segments *segments,Ways *ways,index_t start,Profile *profile);
64 Results *FindFinishRoutes(Nodes *nodes,Segments *segments,Ways *ways,index_t finish,Profile *profile);
66 Results *CombineRoutes(Results *results,Nodes *nodes,Segments *segments,Ways *ways,Profile *profile);
68 void FixForwardRoute(Results *results,index_t finish);
73 void PrintRoute(Results **results,int nresults,Nodes *nodes,Segments *segments,Ways *ways,Profile *profile);
78 /*+ The type, size and alignment of variable to store the variable length +*/
79 #define FILESORT_VARINT unsigned short
80 #define FILESORT_VARSIZE sizeof(FILESORT_VARINT)
81 #define FILESORT_VARALIGN sizeof(void*)
83 void filesort_fixed(int fd_in,int fd_out,size_t itemsize,int (*compare)(const void*,const void*),int (*buildindex)(void*,index_t));
85 void filesort_vary(int fd_in,int fd_out,int (*compare)(const void*,const void*),int (*buildindex)(void*,index_t));
87 void filesort_heapsort(void **datap,size_t nitems,int(*compare)(const void*, const void*));
90 #endif /* FUNCTIONS_H */