From 784b6e5592a90d5794ce0c933d11806f5a6f3b90 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Wed, 9 Jan 2008 10:57:04 +0200 Subject: [PATCH] Move WRITE_STRING to gpx.c as it's the only user. --- src/gpx.c | 16 ++++++++++++++++ src/utils.h | 18 ------------------ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/gpx.c b/src/gpx.c index 6b148ac..287fa11 100644 --- a/src/gpx.c +++ b/src/gpx.c @@ -57,6 +57,22 @@ #define XML_DATE_FORMAT "%FT%T" +#define WRITE_STRING(string) { \ + GnomeVFSResult vfs_result; \ + GnomeVFSFileSize size; \ + if(GNOME_VFS_OK != (vfs_result = gnome_vfs_write( \ + handle, (string), strlen((string)), &size))) \ + { \ + gchar buffer[BUFFER_SIZE]; \ + snprintf(buffer, sizeof(buffer), \ + "%s:\n%s\n%s", _("Error while writing to file"), \ + _("File is incomplete."), \ + gnome_vfs_result_to_string(vfs_result)); \ + popup_error(_window, buffer); \ + return FALSE; \ + } \ +} + /** This enum defines the states of the SAX parsing state machine. */ typedef enum { START, diff --git a/src/utils.h b/src/utils.h index f7b0cb3..929f3b4 100644 --- a/src/utils.h +++ b/src/utils.h @@ -36,10 +36,8 @@ #include #include #include -#include #include #include -#include #include "path.h" #include "mapper-types.h" @@ -319,22 +317,6 @@ if (_http_proxy_host) { \ #define MACRO_BANNER_SHOW_INFO(A, S) { hildon_banner_show_information(A, NULL, S); } #endif -#define WRITE_STRING(string) { \ - GnomeVFSResult vfs_result; \ - GnomeVFSFileSize size; \ - if(GNOME_VFS_OK != (vfs_result = gnome_vfs_write( \ - handle, (string), strlen((string)), &size))) \ - { \ - gchar buffer[BUFFER_SIZE]; \ - snprintf(buffer, sizeof(buffer), \ - "%s:\n%s\n%s", _("Error while writing to file"), \ - _("File is incomplete."), \ - gnome_vfs_result_to_string(vfs_result)); \ - popup_error(_window, buffer); \ - return FALSE; \ - } \ -} - void sound_noise(void); gint download_comparefunc(const ProgressUpdateInfo * a, const ProgressUpdateInfo * b, gpointer user_data); void integerize_data(GpsData *gps, Point *pos); -- 2.39.5