changeset 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 1cfad48b7d93
children 8a932c488afc
files src/gaim.h src/html.c src/protocols/toc/toc.c
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaim.h	Thu Jan 16 22:39:22 2003 +0000
+++ b/src/gaim.h	Fri Jan 17 04:24:29 2003 +0000
@@ -401,7 +401,7 @@
 	char page[255];
 };
 
-extern void grab_url(char *, gboolean, void (*callback)(gpointer, char *), gpointer);
+extern void grab_url(char *, gboolean, void (*callback)(gpointer, char *, unsigned long), gpointer);
 extern gchar *strip_html(gchar *);
 struct g_url *parse_url(char *url);
 
--- 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);
 	}
 }
--- a/src/protocols/toc/toc.c	Thu Jan 16 22:39:22 2003 +0000
+++ b/src/protocols/toc/toc.c	Fri Jan 17 04:24:29 2003 +0000
@@ -423,7 +423,7 @@
 	return rp;
 }
 
-static void toc_got_info(gpointer data, char *url_text)
+static void toc_got_info(gpointer data, char *url_text, unsigned long len)
 {
 	if (!url_text)
 		return;