gchar *tfile;
tfile=gnome_vfs_uri_make_full_from_relative(config_dir, file);
if (GNOME_VFS_OK == gnome_vfs_create(&handle, tfile, GNOME_VFS_OPEN_WRITE, FALSE, 0600)) {
- write_gpx(path, handle);
+ gpx_write(path, handle);
gnome_vfs_close(handle);
}
g_free(tfile);
pfile = gnome_vfs_uri_make_full_from_relative(config_dir, file);
if (GNOME_VFS_OK == gnome_vfs_read_entire_file(pfile, &size, &bytes))
- parse_gpx(path, bytes, size, 0); /* 0 to replace track. */
+ gpx_parse(path, bytes, size, 0); /* 0 to replace track. */
g_free(pfile);
}
}
gboolean
-write_gpx(Path *path, GnomeVFSHandle *handle)
+gpx_write(Path *path, GnomeVFSHandle *handle)
{
Point *curr = NULL;
WayPoint *wcurr = NULL;
}
gboolean
-parse_gpx(Path *to_replace, gchar *buffer, gint size, gint policy_old)
+gpx_parse(Path *to_replace, gchar *buffer, gint size, gint policy_old)
{
SaxData data;
xmlSAXHandler sax_handler;
#include "path.h"
void gpx_init(void);
-gboolean write_gpx(Path *path, GnomeVFSHandle *handle);
-gboolean parse_gpx(Path *to_replace, gchar *buffer, gint size, gint policy_old);
+gboolean gpx_write(Path *path, GnomeVFSHandle *handle);
+gboolean gpx_parse(Path *to_replace, gchar *buffer, gint size, gint policy_old);
#endif
if (msg->easy_handle == _autoroute_data.curl_easy) {
/* This is the autoroute download. */
/* Now, parse the autoroute and update the display. */
- if (_autoroute_data.enabled && parse_gpx(&_route, _autoroute_data.rdl_data.bytes, _autoroute_data.rdl_data.bytes_read, 0)) {
+ if (_autoroute_data.enabled && gpx_parse(&_route, _autoroute_data.rdl_data.bytes, _autoroute_data.rdl_data.bytes_read, 0)) {
/* Find the nearest route point, if we're connected. */
route_find_nearest_point();
map_force_redraw();
if (file_open_get_contents(_route_dir_uri, &buffer, &size)) {
/* If auto is enabled, append the route, otherwise replace it. */
- if (parse_gpx(_route, buffer, size, _autoroute_data.enabled ? 0 : 1)) {
+ if (gpx_parse(_route, buffer, size, _autoroute_data.enabled ? 0 : 1)) {
route_cancel_autoroute(FALSE);
MACRO_BANNER_SHOW_INFO(_window, _("Route Opened"));
}
if (file_save(&_route_dir_uri, &_route_dir_uri, &handle)) {
- if (write_gpx(_route, handle)) {
+ if (gpx_write(_route, handle)) {
MACRO_BANNER_SHOW_INFO(_window, _("Route Saved"));
} else {
popup_error(_window, _("Error writing GPX file."));
/* Let them try again. */
}
/* Else, if GPS is enabled, replace the route, otherwise append it. */
- else if (parse_gpx(_route, rdl_data.bytes, rdl_data.bytes_read,
+ else if (gpx_parse(_route, rdl_data.bytes, rdl_data.bytes_read,
(gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(oti.rad_use_gps)) ? 0 : 1))) {
GtkTreeIter iter;
gboolean r = FALSE;
if (file_open_get_contents(&_track_file_uri, &buffer, &size)) {
- if (parse_gpx(_track, buffer, size, -1)) {
+ if (gpx_parse(_track, buffer, size, -1)) {
map_force_redraw();
MACRO_BANNER_SHOW_INFO(_window, _("Track Opened"));
r = TRUE;
gboolean r = FALSE;
if (file_save(&_track_file_uri, &_track_file_uri, &handle)) {
- if (write_gpx(_track, handle)) {
+ if (gpx_write(_track, handle)) {
MACRO_BANNER_SHOW_INFO(_window, _("Track Saved"));
r = TRUE;
track_clear();