diff lib/cache.c @ 186:13ca1defdc75

2003-6-16 Brian Masney <masneyb@gftp.org> * lib/gftp.h src/text/gftp-text.c src/gtk/misc-gtk.c - changed 2nd parameter of logging function to be a request structure, instead of request->user_data. In the logging functions, if the string isn't in UTF-8, convert it with gftp_string_to_utf8() * lib/bookmark.c lib/cache.c lib/gftp.h lib/https.c lib/local.c lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c lib/sslcommon.c src/gtk/chmod_dialog.c src/gtk/delete_dialog.c src/gtk/gftp-gtk.h src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/mkdir_dialog.c src/gtk/rename_dialog.c src/gtk/transfer.c src/text/gftp-text.c src/gtk/gftp-gtk.h src/text/gftp-text.h - pass request structure to logging function instead of request->user_data
author masneyb
date Tue, 17 Jun 2003 10:49:16 +0000
parents 33b394ebba68
children 876747813a60
line wrap: on
line diff
--- a/lib/cache.c	Tue Jun 17 10:13:26 2003 +0000
+++ b/lib/cache.c	Tue Jun 17 10:49:16 2003 +0000
@@ -44,7 +44,7 @@
   if ((pos = strchr (line, '\t')) == NULL || *(pos + 1) == '\0')
     {
       if (request != NULL)
-        request->logging_function (gftp_logging_error, request->user_data,
+        request->logging_function (gftp_logging_error, request,
                             _("Error: Invalid line %s in cache index file\n"), 
                             line);
       return (-1);
@@ -58,7 +58,7 @@
   if ((pos = strchr (pos, '\t')) == NULL || *(pos + 1) == '\0')
     {
       if (request != NULL)
-        request->logging_function (gftp_logging_error, request->user_data,
+        request->logging_function (gftp_logging_error, request,
                             _("Error: Invalid line %s in cache index file\n"), 
                             line);
       return (-1);
@@ -109,7 +109,7 @@
       if (mkdir (cachedir, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
         {
           if (request != NULL)
-            request->logging_function (gftp_logging_error, request->user_data,
+            request->logging_function (gftp_logging_error, request,
                                  _("Error: Could not make directory %s: %s\n"),
                                  cachedir, g_strerror (errno));
 
@@ -133,7 +133,7 @@
     {
       g_free (tempstr);
       if (request != NULL)
-        request->logging_function (gftp_logging_error, request->user_data,
+        request->logging_function (gftp_logging_error, request,
                                  _("Error: Cannot create temporary file: %s\n"),
                                  g_strerror (errno));
       return (-1);
@@ -155,7 +155,7 @@
   if (close (fd) != 0 || ret < 0)
     {
       if (request != NULL)
-        request->logging_function (gftp_logging_error, request->user_data,
+        request->logging_function (gftp_logging_error, request,
                                    _("Error closing file descriptor: %s\n"),
                                    g_strerror (errno));
 
@@ -197,8 +197,7 @@
 	  if (close (indexfd) != 0)
             {
               if (request != NULL)
-                request->logging_function (gftp_logging_error, 
-                                       request->user_data,
+                request->logging_function (gftp_logging_error, request,
                                        _("Error closing file descriptor: %s\n"),
                                        g_strerror (errno));
               return (-1);
@@ -216,8 +215,7 @@
           if (lseek (cachefd, 0, SEEK_SET) == -1)
             {
               if (request != NULL)
-                request->logging_function (gftp_logging_error, 
-                                       request->user_data,
+                request->logging_function (gftp_logging_error, request,
                                        _("Error: Cannot seek on file %s: %s\n"),
                                        centry.file, g_strerror (errno));