-#include <config.h>
-
-#define _GNU_SOURCE
+#include "config.h"
#ifndef _MAPPER_ROUTE_H
#define _MAPPER_ROUTE_H
#include "utils.h"
#include "mapper-types.h"
+#include "path.h"
+#include "position.h"
-/** The current track and route. */
-Path _track;
-Path _route;
+/** The current route. */
+Path *_route;
-/** Data for tracking waypoints for the purpose of announcement. */
+/** The singleton auto-route-download data. */
+AutoRouteDownloadData _autoroute_data;
-/* _near_point is the route point to which we are closest. */
-Point *_near_point;
-guint64 _near_point_dist_squared;
+gboolean route_open_file(Path *route);
+gboolean route_save(Path *route);
+gboolean route_download(Path *route, gchar *to);
+gboolean route_clear(Path *route);
-/* _next_way is what we currently interpret to be the next waypoint. */
-WayPoint *_next_way;
-guint64 _next_way_dist_squared;
-gchar *_last_spoken_phrase;
+void route_check_waypoint_announce(Path *route, GpsData *gps);
+void route_autoroute_check(Path *route);
-/* _next_wpt is the route point immediately following _next_way. */
-Point *_next_wpt;
-guint64 _next_wpt_dist_squared;
+gboolean route_auto_route_dl_idle_cb();
+void route_cancel_autoroute(Path *route, gboolean temporary);
-/** The singleton auto-route-download data. */
-AutoRouteDownloadData _autoroute_data;
+void route_find_nearest_point(Path *route);
+WayPoint *route_find_nearest_waypoint(Path *route, guint unitx, guint unity);
+
+gboolean route_update_nears(Path *route, gboolean quick);
+
+gboolean route_set_destination_from_last(Path *route, Position *pos);
-gboolean auto_route_dl_idle();
+gboolean route_show_distance_to(Path *route, Point *point);
+void route_show_distance_to_last(Path *route);
+void route_show_distance_to_next(Path *route);
#endif