Index: protocols/proxy.c
===================================================================
--- protocols/proxy.c	(revision ecf8fa820aa8fa3592bdf96ed3bdeec4ec94f036)
+++ protocols/proxy.c	(revision 09f8cd1fedff2022da395d8accc9ac71a16215ea)
@@ -49,5 +49,5 @@
 
 struct PHB {
-	GaimInputFunction func, proxy_func;
+	b_event_handler func, proxy_func;
 	gpointer data, proxy_data;
 	char *host;
@@ -78,5 +78,5 @@
 }
 
-static void gaim_io_connected(gpointer data, gint source, GaimInputCondition cond)
+static gboolean gaim_io_connected(gpointer data, gint source, b_input_condition cond)
 {
 	struct PHB *phb = data;
@@ -88,5 +88,5 @@
 	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
 		closesocket(source);
-		gaim_input_remove(phb->inpa);
+		b_event_remove(phb->inpa);
 		if( phb->proxy_func )
 			phb->proxy_func(phb->proxy_data, -1, GAIM_INPUT_READ);
@@ -95,9 +95,9 @@
 			g_free(phb);
 		}
-		return;
+		return FALSE;
 	}
 #endif
 	sock_make_blocking(source);
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 	if( phb->proxy_func )
 		phb->proxy_func(phb->proxy_data, source, GAIM_INPUT_READ);
@@ -106,4 +106,6 @@
 		g_free(phb);
 	}
+	
+	return FALSE;
 }
 
@@ -127,5 +129,5 @@
 	if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0) {
 		if (sockerr_again()) {
-			phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb);
+			phb->inpa = b_input_add(fd, GAIM_INPUT_WRITE, gaim_io_connected, phb);
 			phb->fd = fd;
 		} else {
@@ -145,5 +147,5 @@
 #define HTTP_GOODSTRING2 "HTTP/1.1 200 Connection established"
 
-static void http_canread(gpointer data, gint source, GaimInputCondition cond)
+static gboolean http_canread(gpointer data, gint source, b_input_condition cond)
 {
 	int nlc = 0;
@@ -152,5 +154,5 @@
 	char inputline[8192];
 
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 
 	while ((pos < sizeof(inputline)-1) && (nlc != 2) && (read(source, &inputline[pos++], 1) == 1)) {
@@ -167,5 +169,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -174,8 +176,9 @@
 	g_free(phb->host);
 	g_free(phb);
-	return;
-}
-
-static void http_canwrite(gpointer data, gint source, GaimInputCondition cond)
+	
+	return FALSE;
+}
+
+static gboolean http_canwrite(gpointer data, gint source, b_input_condition cond)
 {
 	char cmd[384];
@@ -184,5 +187,5 @@
 	int error = ETIMEDOUT;
 	if (phb->inpa > 0)
-		gaim_input_remove(phb->inpa);
+		b_event_remove(phb->inpa);
 	len = sizeof(error);
 	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
@@ -191,5 +194,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 	sock_make_blocking(source);
@@ -202,5 +205,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -217,5 +220,5 @@
 			g_free(phb->host);
 			g_free(phb);
-			return;
+			return FALSE;
 		}
 	}
@@ -227,8 +230,10 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
-	}
-
-	phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, http_canread, phb);
+		return FALSE;
+	}
+
+	phb->inpa = b_input_add(source, GAIM_INPUT_READ, http_canread, phb);
+	
+	return FALSE;
 }
 
@@ -246,10 +251,10 @@
 /* Connecting to SOCKS4 proxies */
 
-static void s4_canread(gpointer data, gint source, GaimInputCondition cond)
+static gboolean s4_canread(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char packet[12];
 	struct PHB *phb = data;
 
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 
 	memset(packet, 0, sizeof(packet));
@@ -258,5 +263,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -265,7 +270,9 @@
 	g_free(phb->host);
 	g_free(phb);
-}
-
-static void s4_canwrite(gpointer data, gint source, GaimInputCondition cond)
+	
+	return FALSE;
+}
+
+static gboolean s4_canwrite(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char packet[12];
@@ -275,5 +282,5 @@
 	int error = ETIMEDOUT;
 	if (phb->inpa > 0)
-		gaim_input_remove(phb->inpa);
+		b_event_remove(phb->inpa);
 	len = sizeof(error);
 	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
@@ -282,5 +289,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 	sock_make_blocking(source);
@@ -292,5 +299,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -309,8 +316,10 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
-	}
-
-	phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, s4_canread, phb);
+		return FALSE;
+	}
+
+	phb->inpa = b_input_add(source, GAIM_INPUT_READ, s4_canread, phb);
+	
+	return FALSE;
 }
 
@@ -328,10 +337,10 @@
 /* Connecting to SOCKS5 proxies */
 
-static void s5_canread_again(gpointer data, gint source, GaimInputCondition cond)
+static gboolean s5_canread_again(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char buf[512];
 	struct PHB *phb = data;
 
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 
 	if (read(source, buf, 10) < 10) {
@@ -340,5 +349,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 	if ((buf[0] != 0x05) || (buf[1] != 0x00)) {
@@ -347,5 +356,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -353,5 +362,6 @@
 	g_free(phb->host);
 	g_free(phb);
-	return;
+	
+	return FALSE;
 }
 
@@ -361,5 +371,5 @@
 	struct PHB *phb = data;
 	int hlen = strlen(phb->host);
-
+	
 	buf[0] = 0x05;
 	buf[1] = 0x01;		/* CONNECT */
@@ -379,13 +389,13 @@
 	}
 
-	phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, s5_canread_again, phb);
-}
-
-static void s5_readauth(gpointer data, gint source, GaimInputCondition cond)
+	phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread_again, phb);
+}
+
+static gboolean s5_readauth(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char buf[512];
 	struct PHB *phb = data;
 
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 
 	if (read(source, buf, 2) < 2) {
@@ -394,5 +404,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -402,16 +412,18 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
 	s5_sendconnect(phb, source);
-}
-
-static void s5_canread(gpointer data, gint source, GaimInputCondition cond)
+	
+	return FALSE;
+}
+
+static gboolean s5_canread(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char buf[512];
 	struct PHB *phb = data;
 
-	gaim_input_remove(phb->inpa);
+	b_event_remove(phb->inpa);
 
 	if (read(source, buf, 2) < 2) {
@@ -420,5 +432,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -428,5 +440,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 
@@ -443,14 +455,16 @@
 			g_free(phb->host);
 			g_free(phb);
-			return;
+			return FALSE;
 		}
 
-		phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, s5_readauth, phb);
+		phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_readauth, phb);
 	} else {
 		s5_sendconnect(phb, source);
 	}
-}
-
-static void s5_canwrite(gpointer data, gint source, GaimInputCondition cond)
+	
+	return FALSE;
+}
+
+static gboolean s5_canwrite(gpointer data, gint source, b_input_condition cond)
 {
 	unsigned char buf[512];
@@ -460,5 +474,5 @@
 	int error = ETIMEDOUT;
 	if (phb->inpa > 0)
-		gaim_input_remove(phb->inpa);
+		b_event_remove(phb->inpa);
 	len = sizeof(error);
 	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
@@ -467,5 +481,5 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
+		return FALSE;
 	}
 	sock_make_blocking(source);
@@ -489,8 +503,10 @@
 		g_free(phb->host);
 		g_free(phb);
-		return;
-	}
-
-	phb->inpa = gaim_input_add(source, GAIM_INPUT_READ, s5_canread, phb);
+		return FALSE;
+	}
+
+	phb->inpa = b_input_add(source, GAIM_INPUT_READ, s5_canread, phb);
+	
+	return FALSE;
 }
 
@@ -508,5 +524,5 @@
 /* Export functions */
 
-int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data)
+int proxy_connect(const char *host, int port, b_event_handler func, gpointer data)
 {
 	struct PHB *phb;
