From: Rob F. <rob...@us...> - 2003-01-17 04:24:32
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv24257 Modified Files: gaim.h html.c Log Message: I decided that the callback for grab_url should return a length, too. Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.361 retrieving revision 1.362 diff -u -d -r1.361 -r1.362 --- gaim.h 7 Jan 2003 17:43:43 -0000 1.361 +++ gaim.h 17 Jan 2003 04:24:29 -0000 1.362 @@ -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); Index: html.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/html.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- html.c 16 Oct 2002 19:46:15 -0000 1.27 +++ html.c 17 Jan 2003 04:24:29 -0000 1.28 @@ -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); } } |