diff src/html.c @ 4322:a789969fc198

[gaim-migrate @ 4577] I decided that the callback for grab_url should return a length, too. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 17 Jan 2003 04:24:29 +0000
parents 988485669631
children bbd7b12986a8
line wrap: on
line diff
--- a/src/html.c	Thu Jan 16 22:39:22 2003 +0000
+++ b/src/html.c	Fri Jan 17 04:24:29 2003 +0000
@@ -115,7 +115,7 @@
 }
 
 struct grab_url_data {
-	void (* callback)(gpointer, char *);
+	void (* callback)(gpointer, char *, unsigned long);
 	gpointer data;
 	struct g_url *website;
 	char *url;
@@ -127,7 +127,7 @@
 	gboolean newline;
 	gboolean startsaving;
 	char *webdata;
-	int len;
+	unsigned long len;
 };
 
 static void grab_url_callback(gpointer dat, gint sock, GaimInputCondition cond)
@@ -136,7 +136,7 @@
 	char data;
 
 	if (sock == -1) {
-		gunk->callback(gunk->data, NULL);
+		gunk->callback(gunk->data, NULL, 0);
 		g_free(gunk->website);
 		g_free(gunk->url);
 		g_free(gunk);
@@ -186,7 +186,7 @@
 
 		gaim_input_remove(gunk->inpa);
 		close(sock);
-		gunk->callback(gunk->data, gunk->webdata);
+		gunk->callback(gunk->data, gunk->webdata, gunk->len);
 		if (gunk->webdata)
 			g_free(gunk->webdata);
 		g_free(gunk->website);
@@ -195,7 +195,7 @@
 	} else {
 		gaim_input_remove(gunk->inpa);
 		close(sock);
-		gunk->callback(gunk->data, NULL);
+		gunk->callback(gunk->data, NULL, 0);
 		if (gunk->webdata)
 			g_free(gunk->webdata);
 		g_free(gunk->website);
@@ -204,7 +204,7 @@
 	}
 }
 
-void grab_url(char *url, gboolean full, void callback(gpointer, char *), gpointer data)
+void grab_url(char *url, gboolean full, void callback(gpointer, char *, unsigned long), gpointer data)
 {
 	int sock;
 	struct grab_url_data *gunk = g_new0(struct grab_url_data, 1);
@@ -220,6 +220,6 @@
 		g_free(gunk->website);
 		g_free(gunk->url);
 		g_free(gunk);
-		callback(data, g_strdup(_("g003: Error opening connection.\n")));
+		callback(data, g_strdup(_("g003: Error opening connection.\n")), 0);
 	}
 }