Imported Upstream version 1.5
[routino] / src / functions.h
index 1ff10de..ffa499e 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************
- $Header: /home/amb/routino/src/RCS/functions.h,v 1.54 2010/04/24 16:47:56 amb Exp $
+ $Header: /home/amb/routino/src/RCS/functions.h,v 1.58 2010/09/25 13:54:18 amb Exp $
 
  Header file for function prototypes
 
 #ifndef FUNCTIONS_H
 #define FUNCTIONS_H    /*+ To stop multiple inclusions. +*/
 
-#include <sys/types.h>
-#include <stdio.h>
-
 #include "types.h"
+
 #include "profiles.h"
 #include "results.h"
 
 
-/* In router.c */
+/*+ The number of waypoints allowed to be specified. +*/
+#define NWAYPOINTS 99
+
+
+/* In fakes.c */
 
 /*+ Return true if this is a fake node. +*/
-#define IsFakeNode(xxx)  ((xxx)&NODE_SUPER)
+#define IsFakeNode(xxx)    ((xxx)>=NODE_FAKE)
+
+/*+ Return true if this is a fake segment. +*/
+#define IsFakeSegment(xxx) ((xxx)>=SEGMENT_FAKE)
 
 index_t CreateFakes(Nodes *nodes,int point,Segment *segment,index_t node1,index_t node2,distance_t dist1,distance_t dist2);
 
@@ -46,29 +51,8 @@ Segment *FirstFakeSegment(index_t node);
 Segment *NextFakeSegment(Segment *segment,index_t node);
 Segment *ExtraFakeSegment(index_t node,index_t fakenode);
 
-
-/* In files.c */
-
-char *FileName(const char *dirname,const char *prefix, const char *name);
-
-void *MapFile(const char *filename);
-void *UnmapFile(const char *filename);
-
-int OpenFile(const char *filename);
-int AppendFile(const char *filename);
-int ReOpenFile(const char *filename);
-
-int WriteFile(int fd,const void *address,size_t length);
-int ReadFile(int fd,void *address,size_t length);
-
-off_t SizeFile(const char *filename);
-int ExistsFile(const char *filename);
-
-int SeekFile(int fd,off_t position);
-
-void CloseFile(int fd);
-
-int DeleteFile(char *filename);
+Segment *LookupFakeSegment(index_t index);
+index_t IndexFakeSegment(Segment *segment);
 
 
 /* In optimiser.c */
@@ -100,7 +84,7 @@ void filesort_fixed(int fd_in,int fd_out,size_t itemsize,int (*compare)(const vo
 
 void filesort_vary(int fd_in,int fd_out,int (*compare)(const void*,const void*),int (*buildindex)(void*,index_t));
 
-void heapsort(void **datap,size_t nitems,int(*compare)(const void*, const void*));
+void filesort_heapsort(void **datap,size_t nitems,int(*compare)(const void*, const void*));
 
 
 #endif /* FUNCTIONS_H */