Index: Makefile
===================================================================
--- Makefile	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ Makefile	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -12,5 +12,5 @@
 objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o
 headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ini.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h url.h user.h protocols/http_client.h protocols/md5.h protocols/nogaim.h protocols/proxy.h protocols/sha.h protocols/ssl_client.h
-subdirs = protocols lib
+subdirs = lib protocols
 
 # Expansion of variables
Index: irc.c
===================================================================
--- irc.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ irc.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -1037,5 +1037,5 @@
 	else if( c && c->ic && c->ic->acc && c->ic->acc->prpl )
 	{
-		return( bim_chat_msg( c, s, 0 ) );
+		return( imc_chat_msg( c, s, 0 ) );
 	}
 	
@@ -1052,5 +1052,5 @@
 	
 	u->sendbuf[u->sendbuf_len-2] = 0; /* Cut off the last newline */
-	bim_buddy_msg( u->ic, u->handle, u->sendbuf, u->sendbuf_flags );
+	imc_buddy_msg( u->ic, u->handle, u->sendbuf, u->sendbuf_flags );
 	
 	g_free( u->sendbuf );
@@ -1104,5 +1104,5 @@
 	else
 	{
-		bim_buddy_msg( u->ic, u->handle, msg, flags );
+		imc_buddy_msg( u->ic, u->handle, msg, flags );
 	}
 }
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ irc_commands.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -463,5 +463,5 @@
 		
 		if( ic && ic->flags & OPT_LOGGED_IN )
-			bim_set_away( ic, u->away );
+			imc_set_away( ic, u->away );
 	}
 }
Index: protocols/jabber/io.c
===================================================================
--- protocols/jabber/io.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/io.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -117,5 +117,5 @@
 		jd->fd = -1;
 		
-		imc_error( ic, "Short write() to server" );
+		imcb_error( ic, "Short write() to server" );
 		imc_logout( ic, TRUE );
 		return FALSE;
@@ -160,5 +160,5 @@
 		if( xt_feed( jd->xt, buf, st ) < 0 )
 		{
-			imc_error( ic, "XML stream error" );
+			imcb_error( ic, "XML stream error" );
 			imc_logout( ic, TRUE );
 			return FALSE;
@@ -203,5 +203,5 @@
 					if( set_getbool( &ic->acc->set, "tls" ) )
 					{
-						imc_error( ic, "TLS is turned on for this "
+						imcb_error( ic, "TLS is turned on for this "
 						          "account, but is not supported by this server" );
 						imc_logout( ic, FALSE );
@@ -216,5 +216,5 @@
 			else
 			{
-				imc_error( ic, "XML stream error" );
+				imcb_error( ic, "XML stream error" );
 				imc_logout( ic, TRUE );
 				return FALSE;
@@ -227,5 +227,5 @@
 		jd->fd = -1;
 		
-		imc_error( ic, "Error while reading from server" );
+		imcb_error( ic, "Error while reading from server" );
 		imc_logout( ic, TRUE );
 		return FALSE;
@@ -242,10 +242,10 @@
 	if( source == -1 )
 	{
-		imc_error( ic, "Could not connect to server" );
+		imcb_error( ic, "Could not connect to server" );
 		imc_logout( ic, TRUE );
 		return FALSE;
 	}
 	
-	imc_log( ic, "Connected to server, logging in" );
+	imcb_log( ic, "Connected to server, logging in" );
 	
 	return jabber_start_stream( ic );
@@ -263,10 +263,10 @@
 		jd->ssl = NULL;
 		
-		imc_error( ic, "Could not connect to server" );
+		imcb_error( ic, "Could not connect to server" );
 		imc_logout( ic, TRUE );
 		return FALSE;
 	}
 	
-	imc_log( ic, "Connected to server, logging in" );
+	imcb_log( ic, "Connected to server, logging in" );
 	
 	return jabber_start_stream( ic );
@@ -297,5 +297,5 @@
 		if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )
 		{
-			imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
+			imcb_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
 			imc_logout( ic, FALSE );
 			
@@ -327,5 +327,5 @@
 		if( !trytls && set_getbool( &ic->acc->set, "tls" ) )
 		{
-			imc_error( ic, "TLS is turned on for this account, but is not supported by this server" );
+			imcb_error( ic, "TLS is turned on for this account, but is not supported by this server" );
 			imc_logout( ic, FALSE );
 			
@@ -417,5 +417,5 @@
 	jd->w_inpa = jd->r_inpa = 0;
 	
-	imc_log( ic, "Converting stream to TLS" );
+	imcb_log( ic, "Converting stream to TLS" );
 	
 	jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic );
@@ -453,5 +453,5 @@
 	if( type == NULL )
 	{
-		imc_error( ic, "Unknown stream error reported by server" );
+		imcb_error( ic, "Unknown stream error reported by server" );
 		imc_logout( ic, allow_reconnect );
 		return XT_ABORT;
@@ -463,10 +463,10 @@
 	if( strcmp( type, "conflict" ) == 0 )
 	{
-		imc_error( ic, "Account and resource used from a different location" );
+		imcb_error( ic, "Account and resource used from a different location" );
 		allow_reconnect = FALSE;
 	}
 	else
 	{
-		imc_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
+		imcb_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
 	}
 	
Index: protocols/jabber/iq.c
===================================================================
--- protocols/jabber/iq.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/iq.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -39,5 +39,5 @@
 	if( !type )
 	{
-		imc_error( ic, "Received IQ packet without type." );
+		imcb_error( ic, "Received IQ packet without type." );
 		imc_logout( ic, TRUE );
 		return XT_ABORT;
@@ -60,5 +60,5 @@
 		
 		if( entry == NULL )
-			imc_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
+			imcb_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
 		else if( entry->func )
 			return entry->func( ic, node, entry->node );
@@ -69,5 +69,5 @@
 		    !( s = xt_find_attr( c, "xmlns" ) ) )
 		{
-			imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
+			imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
 			return XT_HANDLED;
 		}
@@ -132,5 +132,5 @@
 		    !( s = xt_find_attr( c, "xmlns" ) ) )
 		{
-			imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
+			imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
 			return XT_HANDLED;
 		}
@@ -154,5 +154,5 @@
 			else
 			{
-				imc_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
+				imcb_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
 				
 				xt_free_node( reply );
@@ -219,5 +219,5 @@
 	if( !( query = xt_find_node( node->children, "query" ) ) )
 	{
-		imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
+		imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
 		imc_logout( ic, FALSE );
 		return XT_HANDLED;
@@ -258,5 +258,5 @@
 		xt_free_node( reply );
 		
-		imc_error( ic, "Can't find suitable authentication method" );
+		imcb_error( ic, "Can't find suitable authentication method" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
@@ -277,5 +277,5 @@
 	if( !( type = xt_find_attr( node, "type" ) ) )
 	{
-		imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
+		imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
 		imc_logout( ic, FALSE );
 		return XT_HANDLED;
@@ -284,5 +284,5 @@
 	if( strcmp( type, "error" ) == 0 )
 	{
-		imc_error( ic, "Authentication failure" );
+		imcb_error( ic, "Authentication failure" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
@@ -311,5 +311,5 @@
 		if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
 		    strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
-			imc_log( ic, "Server changed session resource string to `%s'", s + 1 );
+			imcb_log( ic, "Server changed session resource string to `%s'", s + 1 );
 		
 		jd->flags &= ~JFLAG_WAIT_BIND;
@@ -334,5 +334,5 @@
 	int st;
 	
-	imc_log( ic, "Authenticated, requesting buddy list" );
+	imcb_log( ic, "Authenticated, requesting buddy list" );
 	
 	node = xt_new_node( "query", NULL, NULL );
@@ -353,5 +353,5 @@
 	if( !( query = xt_find_node( node->children, "query" ) ) )
 	{
-		imc_log( ic, "WARNING: Received NULL roster packet" );
+		imcb_log( ic, "WARNING: Received NULL roster packet" );
 		return XT_HANDLED;
 	}
@@ -397,5 +397,5 @@
 	
 	if( initial )
-		imc_connected( ic );
+		imcb_connected( ic );
 	
 	return XT_HANDLED;
@@ -428,5 +428,5 @@
 	{
 		s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */
-		imc_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
+		imcb_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
 		return XT_HANDLED;
 	}
@@ -536,5 +536,5 @@
 	/* *sigh* */
 	
-	imc_log( ic, "%s", reply->str );
+	imcb_log( ic, "%s", reply->str );
 	g_string_free( reply, TRUE );
 	
Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/jabber.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -59,5 +59,5 @@
 static void jabber_login( account_t *acc )
 {
-	struct im_connection *ic = imc_new( acc );
+	struct im_connection *ic = imcb_new( acc );
 	struct jabber_data *jd = g_new0( struct jabber_data, 1 );
 	struct ns_srv_reply *srv = NULL;
@@ -72,5 +72,5 @@
 	if( jd->server == NULL )
 	{
-		imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
+		imcb_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
 		imc_logout( ic, FALSE );
 		return;
@@ -159,10 +159,10 @@
 		connect_to = jd->server;
 	
-	imc_log( ic, "Connecting" );
+	imcb_log( ic, "Connecting" );
 	
 	if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN ||
 	    set_getint( &acc->set, "port" ) > JABBER_PORT_MAX )
 	{
-		imc_log( ic, "Incorrect port number, must be in the %d-%d range",
+		imcb_log( ic, "Incorrect port number, must be in the %d-%d range",
 		               JABBER_PORT_MIN, JABBER_PORT_MAX );
 		imc_logout( ic, FALSE );
@@ -186,5 +186,5 @@
 	if( jd->fd == -1 )
 	{
-		imc_error( ic, "Could not connect to server" );
+		imcb_error( ic, "Could not connect to server" );
 		imc_logout( ic, TRUE );
 	}
@@ -285,5 +285,5 @@
 	while( bud )
 	{
-		imc_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
+		imcb_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
 		                   bud->full_jid, bud->priority,
 		                   bud->away_state ? bud->away_state->full_name : "(none)",
Index: protocols/jabber/jabber_util.c
===================================================================
--- protocols/jabber/jabber_util.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/jabber_util.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -224,5 +224,5 @@
 	
 	if( find_buddy( bla->ic, bla->handle ) == NULL )
-		show_got_added( bla->ic, bla->handle, NULL );
+		imcb_ask_add( bla->ic, bla->handle, NULL );
 	
 	g_free( bla->handle );
@@ -247,5 +247,5 @@
 	
 	buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle );
-	do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
+	imcb_ask( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
 	g_free( buf );
 }
Index: protocols/jabber/presence.c
===================================================================
--- protocols/jabber/presence.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/presence.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -41,5 +41,5 @@
 		{
 			if( set_getbool( &ic->irc->set, "debug" ) )
-				imc_log( ic, "WARNING: Could not handle presence information from JID: %s", from );
+				imcb_log( ic, "WARNING: Could not handle presence information from JID: %s", from );
 			return XT_HANDLED;
 		}
@@ -74,5 +74,5 @@
 		{
 			if( set_getbool( &ic->irc->set, "debug" ) )
-				imc_log( ic, "WARNING: Received presence information from unknown JID: %s", from );
+				imcb_log( ic, "WARNING: Received presence information from unknown JID: %s", from );
 			return XT_HANDLED;
 		}
@@ -103,5 +103,5 @@
 	{
 		/* Not sure about this one, actually... */
-		imc_log( ic, "%s just accepted your authorization request", from );
+		imcb_log( ic, "%s just accepted your authorization request", from );
 	}
 	else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 )
Index: protocols/jabber/sasl.c
===================================================================
--- protocols/jabber/sasl.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/jabber/sasl.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -38,5 +38,5 @@
 		   IQ authentication. Strange things happen when you try
 		   to do both... */
-		imc_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
+		imcb_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
 		return XT_HANDLED;
 	}
@@ -45,5 +45,5 @@
 	if( !s || strcmp( s, XMLNS_SASL ) != 0 )
 	{
-		imc_log( ic, "Stream error while authenticating" );
+		imcb_log( ic, "Stream error while authenticating" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
@@ -63,5 +63,5 @@
 	if( !sup_plain && !sup_digest )
 	{
-		imc_error( ic, "No known SASL authentication schemes supported" );
+		imcb_error( ic, "No known SASL authentication schemes supported" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
@@ -280,5 +280,5 @@
 
 error:
-	imc_error( ic, "Incorrect SASL challenge received" );
+	imcb_error( ic, "Incorrect SASL challenge received" );
 	imc_logout( ic, FALSE );
 
@@ -304,5 +304,5 @@
 	if( !s || strcmp( s, XMLNS_SASL ) != 0 )
 	{
-		imc_log( ic, "Stream error while authenticating" );
+		imcb_log( ic, "Stream error while authenticating" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
@@ -311,10 +311,10 @@
 	if( strcmp( node->name, "success" ) == 0 )
 	{
-		imc_log( ic, "Authentication finished" );
+		imcb_log( ic, "Authentication finished" );
 		jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART;
 	}
 	else if( strcmp( node->name, "failure" ) == 0 )
 	{
-		imc_error( ic, "Authentication failure" );
+		imcb_error( ic, "Authentication failure" );
 		imc_logout( ic, FALSE );
 		return XT_ABORT;
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/msn/msn.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -39,5 +39,5 @@
 static void msn_login( account_t *acc )
 {
-	struct im_connection *ic = imc_new( acc );
+	struct im_connection *ic = imcb_new( acc );
 	struct msn_data *md = g_new0( struct msn_data, 1 );
 	
@@ -47,15 +47,15 @@
 	if( strchr( acc->user, '@' ) == NULL )
 	{
-		imc_error( ic, "Invalid account name" );
+		imcb_error( ic, "Invalid account name" );
 		imc_logout( ic, FALSE );
 		return;
 	}
 	
-	imc_log( ic, "Connecting" );
+	imcb_log( ic, "Connecting" );
 	
 	md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic );
 	if( md->fd < 0 )
 	{
-		imc_error( ic, "Could not connect to server" );
+		imcb_error( ic, "Could not connect to server" );
 		imc_logout( ic, TRUE );
 		return;
@@ -96,5 +96,5 @@
 				m = l->data;
 			
-				imc_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
+				imcb_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
 				g_free( m->who );
 				g_free( m->text );
@@ -228,5 +228,5 @@
 {
 	/* Just make an URL and let the user fetch the info */
-	imc_log( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );
+	imcb_log( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );
 }
 
@@ -373,5 +373,5 @@
 	if( strlen( value ) > 129 )
 	{
-		imc_log( ic, "Maximum name length exceeded" );
+		imcb_log( ic, "Maximum name length exceeded" );
 		return NULL;
 	}
Index: protocols/msn/msn_util.c
===================================================================
--- protocols/msn/msn_util.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/msn/msn_util.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -36,5 +36,5 @@
 	if( st != len )
 	{
-		imc_error( ic, "Short write() to main server" );
+		imcb_error( ic, "Short write() to main server" );
 		imc_logout( ic, TRUE );
 		return( 0 );
@@ -46,5 +46,5 @@
 int msn_logged_in( struct im_connection *ic )
 {
-	imc_connected( ic );
+	imcb_connected( ic );
 	
 	return( 0 );
@@ -95,5 +95,5 @@
 	
 	if( find_buddy( bla->ic, bla->handle ) == NULL )
-		show_got_added( bla->ic, bla->handle, NULL );
+		imcb_ask_add( bla->ic, bla->handle, NULL );
 	
 	g_free( bla->handle );
@@ -123,5 +123,5 @@
 	            "The user %s (%s) wants to add you to his/her buddy list.",
 	            handle, realname );
-	do_ask_dialog( ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
+	imcb_ask( ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
 }
 
Index: protocols/msn/ns.c
===================================================================
--- protocols/msn/ns.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/msn/ns.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -47,5 +47,5 @@
 	if( source == -1 )
 	{
-		imc_error( ic, "Could not connect to server" );
+		imcb_error( ic, "Could not connect to server" );
 		imc_logout( ic, TRUE );
 		return FALSE;
@@ -76,5 +76,5 @@
 	{
 		ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic );
-		imc_log( ic, "Connected to server, waiting for reply" );
+		imcb_log( ic, "Connected to server, waiting for reply" );
 	}
 	
@@ -89,5 +89,5 @@
 	if( msn_handler( md->handler ) == -1 ) /* Don't do this on ret == 0, it's already done then. */
 	{
-		imc_error( ic, "Error while reading from server" );
+		imcb_error( ic, "Error while reading from server" );
 		imc_logout( ic, TRUE );
 		
@@ -114,5 +114,5 @@
 		if( cmd[2] && strncmp( cmd[2], "MSNP8", 5 ) != 0 )
 		{
-			imc_error( ic, "Unsupported protocol" );
+			imcb_error( ic, "Unsupported protocol" );
 			imc_logout( ic, FALSE );
 			return( 0 );
@@ -143,5 +143,5 @@
 			if( !server )
 			{
-				imc_error( ic, "Syntax error" );
+				imcb_error( ic, "Syntax error" );
 				imc_logout( ic, TRUE );
 				return( 0 );
@@ -151,5 +151,5 @@
 			server = cmd[3];
 			
-			imc_log( ic, "Transferring to other server" );
+			imcb_log( ic, "Transferring to other server" );
 			
 			md->fd = proxy_connect( server, port, msn_ns_connected, ic );
@@ -162,5 +162,5 @@
 			if( !server )
 			{
-				imc_error( ic, "Syntax error" );
+				imcb_error( ic, "Syntax error" );
 				imc_logout( ic, TRUE );
 				return( 0 );
@@ -172,5 +172,5 @@
 			if( strcmp( cmd[4], "CKI" ) != 0 )
 			{
-				imc_error( ic, "Unknown authentication method for switchboard" );
+				imcb_error( ic, "Unknown authentication method for switchboard" );
 				imc_logout( ic, TRUE );
 				return( 0 );
@@ -204,5 +204,5 @@
 		else
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -216,5 +216,5 @@
 			if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )
 			{
-				imc_error( ic, "Error while contacting Passport server" );
+				imcb_error( ic, "Error while contacting Passport server" );
 				imc_logout( ic, TRUE );
 				return( 0 );
@@ -236,5 +236,5 @@
 			}
 			
-			imc_log( ic, "Authenticated, getting buddy list" );
+			imcb_log( ic, "Authenticated, getting buddy list" );
 			
 			g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId );
@@ -243,5 +243,5 @@
 		else
 		{
-			imc_error( ic, "Unknown authentication type" );
+			imcb_error( ic, "Unknown authentication type" );
 			imc_logout( ic, FALSE );
 			return( 0 );
@@ -252,5 +252,5 @@
 		if( num_parts != 4 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -261,5 +261,5 @@
 		if( md->handler->msglen <= 0 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -292,5 +292,5 @@
 		if( num_parts != 4 && num_parts != 5 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -328,5 +328,5 @@
 			if( ic->flags & OPT_LOGGED_IN )
 			{
-				imc_log( ic, "Successfully transferred to different server" );
+				imcb_log( ic, "Successfully transferred to different server" );
 				g_snprintf( buf, sizeof( buf ), "CHG %d %s %d\r\n", ++md->trId, md->away_state->code, 0 );
 				return( msn_write( ic, buf, strlen( buf ) ) );
@@ -344,5 +344,5 @@
 		if( num_parts != 4 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -363,5 +363,5 @@
 		if( num_parts != 3 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -385,5 +385,5 @@
 		if( num_parts != 6 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -413,5 +413,5 @@
 		if( num_parts != 5 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -438,5 +438,5 @@
 		if( num_parts != 7 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -448,5 +448,5 @@
 		if( !server )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -458,5 +458,5 @@
 		if( strcmp( cmd[3], "CKI" ) != 0 )
 		{
-			imc_error( ic, "Unknown authentication method for switchboard" );
+			imcb_error( ic, "Unknown authentication method for switchboard" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -478,5 +478,5 @@
 			if( strchr( cmd[4], '@' ) == NULL )
 			{
-				imc_error( ic, "Syntax error" );
+				imcb_error( ic, "Syntax error" );
 				imc_logout( ic, TRUE );
 				return( 0 );
@@ -501,14 +501,14 @@
 		if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 )
 		{
-			imc_error( ic, "Someone else logged in with your account" );
+			imcb_error( ic, "Someone else logged in with your account" );
 			allow_reconnect = FALSE;
 		}
 		else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 )
 		{
-			imc_error( ic, "Terminating session because of server shutdown" );
+			imcb_error( ic, "Terminating session because of server shutdown" );
 		}
 		else
 		{
-			imc_error( ic, "Session terminated by remote server (reason unknown)" );
+			imcb_error( ic, "Session terminated by remote server (reason unknown)" );
 		}
 		
@@ -520,5 +520,5 @@
 		if( num_parts != 5 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -548,5 +548,5 @@
 	else if( strcmp( cmd[0], "IPG" ) == 0 )
 	{
-		imc_error( ic, "Received IPG command, we don't handle them yet." );
+		imcb_error( ic, "Received IPG command, we don't handle them yet." );
 		
 		md->handler->msglen = atoi( cmd[1] );
@@ -554,5 +554,5 @@
 		if( md->handler->msglen <= 0 )
 		{
-			imc_error( ic, "Syntax error" );
+			imcb_error( ic, "Syntax error" );
 			imc_logout( ic, TRUE );
 			return( 0 );
@@ -564,5 +564,5 @@
 		const struct msn_status_code *err = msn_status_by_number( num );
 		
-		imc_error( ic, "Error reported by MSN server: %s", err->text );
+		imcb_error( ic, "Error reported by MSN server: %s", err->text );
 		
 		if( err->flags & STATUS_FATAL )
@@ -618,5 +618,5 @@
 				{
 					if( arg1 )
-						imc_log( ic, "The server is going down for maintenance in %s minutes.", arg1 );
+						imcb_log( ic, "The server is going down for maintenance in %s minutes.", arg1 );
 				}
 				
@@ -635,5 +635,5 @@
 				if( inbox && folders )
 				{
-					imc_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
+					imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
 				}
 			}
@@ -645,5 +645,5 @@
 				if( from && fromname )
 				{
-					imc_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
+					imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
 				}
 			}
@@ -673,5 +673,5 @@
 	if( key == NULL )
 	{
-		imc_error( ic, "Error during Passport authentication (%s)",
+		imcb_error( ic, "Error during Passport authentication (%s)",
 		               rep->error_string ? rep->error_string : "Unknown error" );
 		imc_logout( ic, TRUE );
Index: protocols/msn/sb.c
===================================================================
--- protocols/msn/sb.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/msn/sb.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -222,5 +222,5 @@
 		g_slist_free( sb->msgq );
 		
-		imc_log( ic, "Warning: Closing down MSN switchboard connection with "
+		imcb_log( ic, "Warning: Closing down MSN switchboard connection with "
 		                   "unsent message to %s, you'll have to resend it.",
 		                   sb->who ? sb->who : "(unknown)" );
@@ -321,5 +321,5 @@
 	if( strcmp( cmd[0], "XFR" ) == 0 )
 	{
-		imc_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
+		imcb_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
 		imc_logout( ic, TRUE );
 		return( 0 );
@@ -528,5 +528,5 @@
 		const struct msn_status_code *err = msn_status_by_number( num );
 		
-		imc_error( ic, "Error reported by switchboard server: %s", err->text );
+		imcb_error( ic, "Error reported by switchboard server: %s", err->text );
 		
 		if( err->flags & STATUS_SB_FATAL )
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/nogaim.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -145,5 +145,5 @@
 /* multi.c */
 
-struct im_connection *imc_new( account_t *acc )
+struct im_connection *imcb_new( account_t *acc )
 {
 	struct im_connection *ic;
@@ -204,5 +204,5 @@
 }
 
-void imc_log( struct im_connection *ic, char *format, ... )
+void imcb_log( struct im_connection *ic, char *format, ... )
 {
 	va_list params;
@@ -221,5 +221,5 @@
 }
 
-void imc_error( struct im_connection *ic, char *format, ... )
+void imcb_error( struct im_connection *ic, char *format, ... )
 {
 	va_list params;
@@ -248,5 +248,5 @@
 }
 
-void imc_connected( struct im_connection *ic )
+void imcb_connected( struct im_connection *ic )
 {
 	user_t *u;
@@ -260,5 +260,5 @@
 	u = user_find( ic->irc, ic->irc->nick );
 	
-	imc_log( ic, "Logged in" );
+	imcb_log( ic, "Logged in" );
 	
 	ic->keepalive = b_timeout_add( 60000, send_keepalive, ic );
@@ -267,5 +267,5 @@
 	/* Also necessary when we're not away, at least for some of the
 	   protocols. */
-	bim_set_away( ic, u->away );
+	imc_set_away( ic, u->away );
 }
 
@@ -300,5 +300,5 @@
 		ic->flags |= OPT_LOGGING_OUT;
 	
-	imc_log( ic, "Signing off.." );
+	imcb_log( ic, "Signing off.." );
 	
 	b_event_remove( ic->keepalive );
@@ -334,5 +334,5 @@
 		int delay = set_getint( &irc->set, "auto_reconnect_delay" );
 		
-		imc_log( ic, "Reconnecting in %d seconds..", delay );
+		imcb_log( ic, "Reconnecting in %d seconds..", delay );
 		a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a );
 	}
@@ -344,5 +344,5 @@
 /* dialogs.c */
 
-void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
+void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
 {
 	query_add( ic->irc, ic, msg, doit, dont, data );
@@ -360,10 +360,10 @@
 	
 	if( set_getbool( &irc->set, "debug" ) && 0 ) /* This message is too useless */
-		imc_log( ic, "Receiving user add from handle: %s", handle );
+		imcb_log( ic, "Receiving user add from handle: %s", handle );
 	
 	if( user_findhandle( ic, handle ) )
 	{
 		if( set_getbool( &irc->set, "debug" ) )
-			imc_log( ic, "User already exists, ignoring add request: %s", handle );
+			imcb_log( ic, "User already exists, ignoring add request: %s", handle );
 		
 		return;
@@ -448,5 +448,5 @@
 		
 		if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) )
-			imc_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
+			imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
 	}
 }
@@ -475,5 +475,5 @@
 }
 
-void show_got_added( struct im_connection *ic, char *handle, const char *realname )
+void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname )
 {
 	struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 );
@@ -512,6 +512,6 @@
 			if( set_getbool( &ic->irc->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 )
 			{
-				imc_log( ic, "serv_got_update() for handle %s:", handle );
-				imc_log( ic, "loggedin = %d, type = %d", loggedin, type );
+				imcb_log( ic, "serv_got_update() for handle %s:", handle );
+				imcb_log( ic, "loggedin = %d, type = %d", loggedin, type );
 			}
 			
@@ -551,13 +551,4 @@
 	{
 		u->away = g_strdup( "Away" );
-	}
-	else if( ( type & UC_UNAVAILABLE ) && ( strcmp( ic->acc->prpl->name, "jabber" ) == 0 ) )
-	{
-		if( type & UC_DND )
-			u->away = g_strdup( "Do Not Disturb" );
-		else if( type & UC_XA )
-			u->away = g_strdup( "Extended Away" );
-		else // if( type & UC_AWAY )
-			u->away = g_strdup( "Away" );
 	}
 	else if( ( type & UC_UNAVAILABLE ) && ic->acc->prpl->get_status_string )
@@ -593,5 +584,5 @@
 		{
 			if( set_getbool( &irc->set, "debug" ) )
-				imc_log( ic, "Ignoring message from unknown handle %s", handle );
+				imcb_log( ic, "Ignoring message from unknown handle %s", handle );
 			
 			return;
@@ -615,5 +606,5 @@
 		else
 		{
-			imc_log( ic, "Message from unknown handle %s:", handle );
+			imcb_log( ic, "Message from unknown handle %s:", handle );
 			u = user_find( irc, irc->mynick );
 		}
@@ -685,5 +676,5 @@
 	
 	if( set_getbool( &ic->irc->set, "debug" ) )
-		imc_log( ic, "You were removed from conversation 0x%x", (int) c );
+		imcb_log( ic, "You were removed from conversation 0x%x", (int) c );
 	
 	if( c )
@@ -733,5 +724,5 @@
 		irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", msg );
 	else
-		imc_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
+		imcb_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
 }
 
@@ -755,5 +746,5 @@
 	
 	if( set_getbool( &ic->irc->set, "debug" ) )
-		imc_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
+		imcb_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
 	
 	return c;
@@ -769,5 +760,5 @@
 	
 	if( set_getbool( &b->ic->irc->set, "debug" ) )
-		imc_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
+		imcb_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
 	
 	/* It might be yourself! */
@@ -803,5 +794,5 @@
 	
 	if( set_getbool( &b->ic->irc->set, "debug" ) )
-		imc_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
+		imcb_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
 	
 	/* It might be yourself! */
@@ -929,5 +920,5 @@
    them all from some wrappers. We'll start to define some down here: */
 
-int bim_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags )
+int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags )
 {
 	char *buf = NULL;
@@ -946,5 +937,5 @@
 }
 
-int bim_chat_msg( struct groupchat *c, char *msg, int flags )
+int imc_chat_msg( struct groupchat *c, char *msg, int flags )
 {
 	char *buf = NULL;
@@ -962,7 +953,7 @@
 }
 
-static char *bim_away_alias_find( GList *gcm, char *away );
-
-int bim_set_away( struct im_connection *ic, char *away )
+static char *imc_away_alias_find( GList *gcm, char *away );
+
+int imc_set_away( struct im_connection *ic, char *away )
 {
 	GList *m, *ms;
@@ -995,10 +986,10 @@
 	else
 	{
-		s = bim_away_alias_find( ms, away );
+		s = imc_away_alias_find( ms, away );
 		if( s )
 		{
 			ic->acc->prpl->set_away( ic, s, away );
 			if( set_getbool( &ic->irc->set, "debug" ) )
-				imc_log( ic, "Setting away state to %s", s );
+				imcb_log( ic, "Setting away state to %s", s );
 		}
 		else
@@ -1009,5 +1000,5 @@
 }
 
-static char *bim_away_alias_list[8][5] =
+static char *imc_away_alias_list[8][5] =
 {
 	{ "Away from computer", "Away", "Extended away", NULL },
@@ -1021,26 +1012,26 @@
 };
 
-static char *bim_away_alias_find( GList *gcm, char *away )
+static char *imc_away_alias_find( GList *gcm, char *away )
 {
 	GList *m;
 	int i, j;
 	
-	for( i = 0; *bim_away_alias_list[i]; i ++ )
-	{
-		for( j = 0; bim_away_alias_list[i][j]; j ++ )
-			if( g_strncasecmp( away, bim_away_alias_list[i][j], strlen( bim_away_alias_list[i][j] ) ) == 0 )
+	for( i = 0; *imc_away_alias_list[i]; i ++ )
+	{
+		for( j = 0; imc_away_alias_list[i][j]; j ++ )
+			if( g_strncasecmp( away, imc_away_alias_list[i][j], strlen( imc_away_alias_list[i][j] ) ) == 0 )
 				break;
 		
-		if( !bim_away_alias_list[i][j] )	/* If we reach the end, this row */
+		if( !imc_away_alias_list[i][j] )	/* If we reach the end, this row */
 			continue;			/* is not what we want. Next!    */
 		
 		/* Now find an entry in this row which exists in gcm */
-		for( j = 0; bim_away_alias_list[i][j]; j ++ )
+		for( j = 0; imc_away_alias_list[i][j]; j ++ )
 		{
 			m = gcm;
 			while( m )
 			{
-				if( g_strcasecmp( bim_away_alias_list[i][j], m->data ) == 0 )
-					return( bim_away_alias_list[i][j] );
+				if( g_strcasecmp( imc_away_alias_list[i][j], m->data ) == 0 )
+					return( imc_away_alias_list[i][j] );
 				m = m->next;
 			}
@@ -1051,5 +1042,5 @@
 }
 
-void bim_add_allow( struct im_connection *ic, char *handle )
+void imc_add_allow( struct im_connection *ic, char *handle )
 {
 	if( g_slist_find_custom( ic->permit, handle, (GCompareFunc) ic->acc->prpl->handle_cmp ) == NULL )
@@ -1061,5 +1052,5 @@
 }
 
-void bim_rem_allow( struct im_connection *ic, char *handle )
+void imc_rem_allow( struct im_connection *ic, char *handle )
 {
 	GSList *l;
@@ -1074,5 +1065,5 @@
 }
 
-void bim_add_block( struct im_connection *ic, char *handle )
+void imc_add_block( struct im_connection *ic, char *handle )
 {
 	if( g_slist_find_custom( ic->deny, handle, (GCompareFunc) ic->acc->prpl->handle_cmp ) == NULL )
@@ -1084,5 +1075,5 @@
 }
 
-void bim_rem_block( struct im_connection *ic, char *handle )
+void imc_rem_block( struct im_connection *ic, char *handle )
 {
 	GSList *l;
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/nogaim.h	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -150,5 +150,5 @@
 	
 	/* Request profile info. Free-formatted stuff, the IM module gives back
-	   this info via imc_log(). */
+	   this info via imcb_log(). */
 	void (* get_info)	(struct im_connection *, char *who);
 	void (* set_my_name)	(struct im_connection *, char *name);
@@ -175,66 +175,56 @@
 #define UC_UNAVAILABLE  1
 
-/* JABBER */
-#define UC_AWAY (0x02 | UC_UNAVAILABLE)
-#define UC_CHAT  0x04
-#define UC_XA   (0x08 | UC_UNAVAILABLE)
-#define UC_DND  (0x10 | UC_UNAVAILABLE)
-
+/* im_api core stuff. */
+void nogaim_init();
 G_MODULE_EXPORT GSList *get_connections();
 G_MODULE_EXPORT struct prpl *find_protocol(const char *name);
 G_MODULE_EXPORT void register_protocol(struct prpl *);
 
-/* nogaim.c */
-int bim_set_away( struct im_connection *ic, char *away );
-int bim_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
-int bim_chat_msg( struct groupchat *c, char *msg, int flags );
-
-void bim_add_allow( struct im_connection *ic, char *handle );
-void bim_rem_allow( struct im_connection *ic, char *handle );
-void bim_add_block( struct im_connection *ic, char *handle );
-void bim_rem_block( struct im_connection *ic, char *handle );
-
-void nogaim_init();
-char *set_eval_away_devoice( set_t *set, char *value );
-
-gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond );
-void cancel_auto_reconnect( struct account *a );
-
-/* multi.c */
-G_MODULE_EXPORT struct im_connection *imc_new( account_t *acc );
-G_MODULE_EXPORT void imc_free( struct im_connection *ic );
-G_MODULE_EXPORT void imc_log( struct im_connection *ic, char *format, ... );
-G_MODULE_EXPORT void imc_error( struct im_connection *ic, char *format, ... );
-G_MODULE_EXPORT void imc_connected( struct im_connection *ic );
+/* Connection management. */
+G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc );
+G_MODULE_EXPORT void imcb_free( struct im_connection *ic );
+G_MODULE_EXPORT void imcb_connected( struct im_connection *ic );
 G_MODULE_EXPORT void imc_logout( struct im_connection *ic, int allow_reconnect );
 
-/* dialogs.c */
-G_MODULE_EXPORT void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
-
-/* list.c */
-G_MODULE_EXPORT void add_buddy( struct im_connection *ic, char *group, char *handle, char *realname );
-G_MODULE_EXPORT struct buddy *find_buddy( struct im_connection *ic, char *handle );
-G_MODULE_EXPORT void signoff_blocked( struct im_connection *ic );
-
-G_MODULE_EXPORT void serv_buddy_rename( struct im_connection *ic, char *handle, char *realname );
-
-/* buddy_chat.c */
+/* Communicating with the user. */
+G_MODULE_EXPORT void imcb_log( struct im_connection *ic, char *format, ... );
+G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... );
+G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
+G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
+
+/* Groupchats */
 G_MODULE_EXPORT void add_chat_buddy( struct groupchat *b, char *handle );
 G_MODULE_EXPORT void remove_chat_buddy( struct groupchat *b, char *handle, char *reason );
-
-/* prpl.c */
-G_MODULE_EXPORT void show_got_added( struct im_connection *ic, char *handle, const char *realname );
-
-/* server.c */
-G_MODULE_EXPORT void serv_got_update( struct im_connection *ic, char *handle, int loggedin, int evil, time_t signon, time_t idle, int type, guint caps );
-G_MODULE_EXPORT void serv_got_im( struct im_connection *ic, char *handle, char *msg, guint32 flags, time_t mtime, gint len );
-G_MODULE_EXPORT void serv_got_typing( struct im_connection *ic, char *handle, int timeout, int type );
 G_MODULE_EXPORT void serv_got_chat_invite( struct im_connection *ic, char *handle, char *who, char *msg, GList *data );
 G_MODULE_EXPORT struct groupchat *serv_got_joined_chat( struct im_connection *ic, char *handle );
 G_MODULE_EXPORT void serv_got_chat_in( struct groupchat *c, char *who, int whisper, char *msg, time_t mtime );
 G_MODULE_EXPORT void serv_got_chat_left( struct groupchat *c );
-
 struct groupchat *chat_by_channel( char *channel );
 struct groupchat *chat_by_id( int id );
 
+/* Buddy management */
+G_MODULE_EXPORT void add_buddy( struct im_connection *ic, char *group, char *handle, char *realname );
+G_MODULE_EXPORT struct buddy *find_buddy( struct im_connection *ic, char *handle );
+G_MODULE_EXPORT void serv_buddy_rename( struct im_connection *ic, char *handle, char *realname );
+
+/* Buddy activity */
+G_MODULE_EXPORT void serv_got_update( struct im_connection *ic, char *handle, int loggedin, int evil, time_t signon, time_t idle, int type, guint caps );
+G_MODULE_EXPORT void serv_got_im( struct im_connection *ic, char *handle, char *msg, guint32 flags, time_t mtime, gint len );
+G_MODULE_EXPORT void serv_got_typing( struct im_connection *ic, char *handle, int timeout, int type );
+
+/* Actions, or whatever. */
+int imc_set_away( struct im_connection *ic, char *away );
+int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
+int imc_chat_msg( struct groupchat *c, char *msg, int flags );
+
+void imc_add_allow( struct im_connection *ic, char *handle );
+void imc_rem_allow( struct im_connection *ic, char *handle );
+void imc_add_block( struct im_connection *ic, char *handle );
+void imc_rem_block( struct im_connection *ic, char *handle );
+
+/* Misc. stuff */
+char *set_eval_away_devoice( set_t *set, char *value );
+gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond );
+void cancel_auto_reconnect( struct account *a );
+
 #endif
Index: protocols/oscar/chat.c
===================================================================
--- protocols/oscar/chat.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/chat.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -54,5 +54,5 @@
 			continue;
 		if (!cur->priv) {
-			imc_error(sess->aux_data, "chat connection with no name!");
+			imcb_error(sess->aux_data, "chat connection with no name!");
 			continue;
 		}
@@ -397,5 +397,5 @@
 
 	if (detaillevel != 0x02) {
-		imc_error(sess->aux_data, "Only detaillevel 0x2 is support at the moment");
+		imcb_error(sess->aux_data, "Only detaillevel 0x2 is support at the moment");
 		return 1;
 	}
@@ -615,5 +615,5 @@
 
 	if (channel != 0x0003) {
-		imc_error(sess->aux_data, "unknown channel!");
+		imcb_error(sess->aux_data, "unknown channel!");
 		return 0;
 	}
Index: protocols/oscar/chatnav.c
===================================================================
--- protocols/oscar/chatnav.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/chatnav.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -286,5 +286,5 @@
 
 	if (!(bigblock = aim_gettlv(tlvlist, 0x0004, 1))) {
-		imc_error(sess->aux_data, "no bigblock in top tlv in create room response");
+		imcb_error(sess->aux_data, "no bigblock in top tlv in create room response");
 	
 		aim_freetlvchain(&tlvlist);
@@ -301,5 +301,5 @@
 
 	if (detaillevel != 0x02) {
-		imc_error(sess->aux_data, "unknown detaillevel in create room response");
+		imcb_error(sess->aux_data, "unknown detaillevel in create room response");
 		aim_freetlvchain(&tlvlist);
 		g_free(ck);
@@ -367,10 +367,10 @@
 
 	if (!(snac2 = aim_remsnac(sess, snac->id))) {
-		imc_error(sess->aux_data, "received response to unknown request!");
+		imcb_error(sess->aux_data, "received response to unknown request!");
 		return 0;
 	}
 
 	if (snac2->family != 0x000d) {
-		imc_error(sess->aux_data, "recieved response that maps to corrupt request!");
+		imcb_error(sess->aux_data, "recieved response that maps to corrupt request!");
 		return 0;
 	}
@@ -389,5 +389,5 @@
 		ret = parseinfo_create(sess, mod, rx, snac, bs, snac2);
 	else
-		imc_error(sess->aux_data, "unknown request subtype");
+		imcb_error(sess->aux_data, "unknown request subtype");
 
 	if (snac2)
Index: protocols/oscar/icq.c
===================================================================
--- protocols/oscar/icq.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/icq.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -240,5 +240,5 @@
 	if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) {
 		aim_freetlvchain(&tl);
-		imc_error(sess->aux_data, "corrupt ICQ response\n");
+		imcb_error(sess->aux_data, "corrupt ICQ response\n");
 		return 0;
 	}
Index: protocols/oscar/im.c
===================================================================
--- protocols/oscar/im.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/im.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -937,5 +937,5 @@
 
 	if (channel != 0x01) {
-		imc_error(sess->aux_data, "icbm: ICBM recieved on unsupported channel.  Ignoring.");
+		imcb_error(sess->aux_data, "icbm: ICBM recieved on unsupported channel.  Ignoring.");
 		return 0;
 	}
@@ -1345,5 +1345,5 @@
 
 		} else {
-			// imc_error(sess->aux_data, "Unknown TLV encountered");
+			// imcb_error(sess->aux_data, "Unknown TLV encountered");
 		}
 
@@ -1517,5 +1517,5 @@
 	cookie2 = aimbs_getraw(&bbs, 8);
 	if (memcmp(cookie, cookie2, 8) != 0) 
-		imc_error(sess->aux_data, "rend: warning cookies don't match!");
+		imcb_error(sess->aux_data, "rend: warning cookies don't match!");
 	memcpy(args.cookie, cookie2, 8);
 	g_free(cookie2);
@@ -1783,5 +1783,5 @@
 	} else {
 
-		imc_error(sess->aux_data, "ICBM received on an unsupported channel.  Ignoring.");
+		imcb_error(sess->aux_data, "ICBM received on an unsupported channel.  Ignoring.");
 
 		return 0;
Index: protocols/oscar/info.c
===================================================================
--- protocols/oscar/info.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/info.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -474,5 +474,5 @@
 			 */
 #ifdef DEBUG
-			// imc_error(sess->aux_data, G_STRLOC);
+			// imcb_error(sess->aux_data, G_STRLOC);
 #endif
 
@@ -635,5 +635,5 @@
 
 	if (!origsnac || !origsnac->data) {
-		imc_error(sess->aux_data, "major problem: no snac stored!");
+		imcb_error(sess->aux_data, "major problem: no snac stored!");
 		return 0;
 	}
@@ -644,5 +644,5 @@
 			(inforeq->infotype != AIM_GETINFO_AWAYMESSAGE) &&
 			(inforeq->infotype != AIM_GETINFO_CAPABILITIES)) {
-		imc_error(sess->aux_data, "unknown infotype in request!");
+		imcb_error(sess->aux_data, "unknown infotype in request!");
 		return 0;
 	}
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/oscar.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -267,5 +267,5 @@
 			if ((conn->type == AIM_CONN_TYPE_BOS) ||
 				   !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
-				imc_error(ic, _("Disconnected."));
+				imcb_error(ic, _("Disconnected."));
 				imc_logout(ic, TRUE);
 			} else if (conn->type == AIM_CONN_TYPE_CHAT) {
@@ -277,5 +277,5 @@
 				c->fd = -1;
 				aim_conn_kill(odata->sess, &conn);
-				imc_error(sess->aux_data, _("You have been disconnected from chat room %s."), c->name);
+				imcb_error(sess->aux_data, _("You have been disconnected from chat room %s."), c->name);
 			} else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
 				if (odata->cnpa > 0)
@@ -288,5 +288,5 @@
 						g_slist_remove(odata->create_rooms, cr);
 					g_free(cr);
-					imc_error(sess->aux_data, _("Chat is currently unavailable"));
+					imcb_error(sess->aux_data, _("Chat is currently unavailable"));
 				}
 				aim_conn_kill(odata->sess, &conn);
@@ -325,5 +325,5 @@
 
 	if (source < 0) {
-		imc_error(ic, _("Couldn't connect to host"));
+		imcb_error(ic, _("Couldn't connect to host"));
 		imc_logout(ic, TRUE);
 		return FALSE;
@@ -353,5 +353,5 @@
 	aim_session_t *sess;
 	aim_conn_t *conn;
-	struct im_connection *ic = imc_new(acc);
+	struct im_connection *ic = imcb_new(acc);
 	struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1);
 
@@ -380,5 +380,5 @@
 	conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
 	if (conn == NULL) {
-		imc_error(ic, _("Unable to login to AIM"));
+		imcb_error(ic, _("Unable to login to AIM"));
 		imc_logout(ic, TRUE);
 		return;
@@ -386,5 +386,5 @@
 	
 	if (acc->server == NULL) {
-		imc_error(ic, "No servername specified");
+		imcb_error(ic, "No servername specified");
 		imc_logout(ic, FALSE);
 		return;
@@ -393,8 +393,8 @@
 	if (g_strcasecmp(acc->server, "login.icq.com") != 0 &&
 	    g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) {
-		imc_log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
-	}
-	
-	imc_log(ic, _("Signon: %s"), ic->acc->user);
+		imcb_log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
+	}
+	
+	imcb_log(ic, _("Signon: %s"), ic->acc->user);
 
 	aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
@@ -404,5 +404,5 @@
 	conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic);
 	if (conn->fd < 0) {
-		imc_error(ic, _("Couldn't connect to host"));
+		imcb_error(ic, _("Couldn't connect to host"));
 		imc_logout(ic, TRUE);
 		return;
@@ -464,5 +464,5 @@
 
 	if (source < 0) {
-		imc_error(ic, _("Could Not Connect"));
+		imcb_error(ic, _("Could Not Connect"));
 		imc_logout(ic, TRUE);
 		return FALSE;
@@ -472,5 +472,5 @@
 	ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
 			oscar_callback, bosconn);
-	imc_log(ic, _("Connection established, cookie sent"));
+	imcb_log(ic, _("Connection established, cookie sent"));
 	
 	return FALSE;
@@ -495,21 +495,21 @@
 		case 0x05:
 			/* Incorrect nick/password */
-			imc_error(ic, _("Incorrect nickname or password."));
+			imcb_error(ic, _("Incorrect nickname or password."));
 //			plugin_event(event_error, (void *)980, 0, 0, 0);
 			break;
 		case 0x11:
 			/* Suspended account */
-			imc_error(ic, _("Your account is currently suspended."));
+			imcb_error(ic, _("Your account is currently suspended."));
 			break;
 		case 0x18:
 			/* connecting too frequently */
-			imc_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
+			imcb_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
 			break;
 		case 0x1c:
 			/* client too old */
-			imc_error(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));
+			imcb_error(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));
 			break;
 		default:
-			imc_error(ic, _("Authentication Failed"));
+			imcb_error(ic, _("Authentication Failed"));
 			break;
 		}
@@ -523,5 +523,5 @@
 	bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, NULL);
 	if (bosconn == NULL) {
-		imc_error(ic, _("Internal Error"));
+		imcb_error(ic, _("Internal Error"));
 		od->killme = TRUE;
 		return 0;
@@ -569,5 +569,5 @@
 	g_free(host);
 	if (bosconn->fd < 0) {
-		imc_error(ic, _("Could Not Connect"));
+		imcb_error(ic, _("Could Not Connect"));
 		od->killme = TRUE;
 		return 0;
@@ -607,5 +607,5 @@
 	}
 	if (in != '\n') {
-		imc_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
+		imcb_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
 				" You may be disconnected shortly.");
 		b_event_remove(pos->inpa);
@@ -630,5 +630,5 @@
 
 	if (source < 0) {
-		imc_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
+		imcb_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
 				" You may be disconnected shortly.");
 		if (pos->modname)
@@ -708,5 +708,5 @@
 			g_free(pos->modname);
 		g_free(pos);
-		imc_error(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM."
+		imcb_error(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM."
 				" You may be disconnected shortly.");
 	}
@@ -1112,5 +1112,5 @@
 		inv->name = g_strdup(name);
 		
-		do_ask_dialog( ic, txt, inv, oscar_accept_chat, oscar_reject_chat);
+		imcb_ask( ic, txt, inv, oscar_accept_chat, oscar_reject_chat);
 	
 		if (name)
@@ -1130,5 +1130,5 @@
 	// aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
 	if(find_buddy(data->ic, uin) == NULL)
-		show_got_added(data->ic, uin, NULL);
+		imcb_ask_add(data->ic, uin, NULL);
 	
 	g_free(uin);
@@ -1164,5 +1164,5 @@
 	data->ic = ic;
 	data->uin = uin;
-	do_ask_dialog(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);
+	imcb_ask(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);
 	g_free(dialog_msg);
 }
@@ -1207,9 +1207,9 @@
 
 		case 0x0007: { /* Someone has denied you authorization */
-			imc_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
+			imcb_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
 		} break;
 
 		case 0x0008: { /* Someone has granted you authorization */
-			imc_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
+			imcb_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
 		} break;
 
@@ -1277,5 +1277,5 @@
 		case 0:
 			/* Invalid (0) */
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ? 
 				   _("You missed %d message from %s because it was invalid.") :
@@ -1286,5 +1286,5 @@
 		case 1:
 			/* Message too large */
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ?
 				   _("You missed %d message from %s because it was too large.") :
@@ -1295,5 +1295,5 @@
 		case 2:
 			/* Rate exceeded */
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ? 
 				   _("You missed %d message from %s because the rate limit has been exceeded.") :
@@ -1304,5 +1304,5 @@
 		case 3:
 			/* Evil Sender */
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ?
 				   _("You missed %d message from %s because it was too evil.") : 
@@ -1313,5 +1313,5 @@
 		case 4:
 			/* Evil Receiver */
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ? 
 				   _("You missed %d message from %s because you are too evil.") :
@@ -1321,5 +1321,5 @@
 			break;
 		default:
-			imc_error(sess->aux_data,
+			imcb_error(sess->aux_data,
 				   nummissed == 1 ? 
 				   _("You missed %d message from %s for unknown reasons.") :
@@ -1341,5 +1341,5 @@
 	va_end(ap);
 
-	imc_error(sess->aux_data, _("SNAC threw error: %s"),
+	imcb_error(sess->aux_data, _("SNAC threw error: %s"),
 	          reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error");
 
@@ -1357,5 +1357,5 @@
 	va_end(ap);
 
-	imc_error(sess->aux_data, _("Your message to %s did not get sent: %s"), destn,
+	imcb_error(sess->aux_data, _("Your message to %s did not get sent: %s"), destn,
 			(reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
 
@@ -1373,5 +1373,5 @@
 	va_end(ap);
 
-	imc_error(sess->aux_data, _("User information for %s unavailable: %s"), destn,
+	imcb_error(sess->aux_data, _("User information for %s unavailable: %s"), destn,
 			(reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
 
@@ -1390,5 +1390,5 @@
 
 	if (id < 4)
-		imc_error(sess->aux_data, _("Your connection may be lost."));
+		imcb_error(sess->aux_data, _("Your connection may be lost."));
 
 	return 1;
@@ -1584,5 +1584,5 @@
 		aim_conn_setlatency(fr->conn, windowsize/4);
 	} else if (code == AIM_RATE_CODE_LIMIT) {
-		imc_error(sess->aux_data, _("The last message was not sent because you are over the rate limit. "
+		imcb_error(sess->aux_data, _("The last message was not sent because you are over the rate limit. "
 			  "Please wait 10 seconds and try again."));
 		aim_conn_setlatency(fr->conn, windowsize/2);
@@ -1789,9 +1789,9 @@
 
 		case 0x0007: { /* Someone has denied you authorization */
-			imc_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
+			imcb_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
 		} break;
 
 		case 0x0008: { /* Someone has granted you authorization */
-			imc_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
+			imcb_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
 		} break;
 
@@ -1906,5 +1906,5 @@
 
 	if (od->rights.maxawaymsglen == 0)
-		imc_error(ic, "oscar_set_away_aim called before locate rights received");
+		imcb_error(ic, "oscar_set_away_aim called before locate rights received");
 
 	aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
@@ -1920,5 +1920,5 @@
 
 	if (strlen(message) > od->rights.maxawaymsglen) {
-		imc_error(ic, "Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
+		imcb_error(ic, "Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
 	}
 
@@ -2084,5 +2084,5 @@
 	
 	/* Now that we have a buddy list, we can tell BitlBee that we're online. */
-	imc_connected(ic);
+	imcb_connected(ic);
 	
 	return 1;
@@ -2106,5 +2106,5 @@
 		{
 			/* Hmm, the length should be even... */
-			imc_error( sess->aux_data, "Received SSI ACK package with non-even length");
+			imcb_error( sess->aux_data, "Received SSI ACK package with non-even length");
 			return( 0 );
 		}
@@ -2117,5 +2117,5 @@
 			if( st == 0x0E )
 			{
-				imc_log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );
+				imcb_log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );
 				
 				aim_ssi_auth_request( sess, fr->conn, list, "" );
@@ -2303,5 +2303,5 @@
         }
 
-		imc_log(ic, "%s\n%s", _("User Info"), str->str);
+		imcb_log(ic, "%s\n%s", _("User Info"), str->str);
         g_string_free(str, TRUE);
 
@@ -2397,16 +2397,16 @@
 			idletime.tm_sec = 0;
 			strftime(buff, 256, _("%d days %H hours %M minutes"), &idletime);
-			imc_log(ic, "%s: %s", _("Idle Time"), buff);
+			imcb_log(ic, "%s: %s", _("Idle Time"), buff);
 		}
 		
 		if(text) {
 			utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
-			imc_log(ic, "%s\n%s", _("User Info"), utf8);
+			imcb_log(ic, "%s\n%s", _("User Info"), utf8);
 		} else {
-			imc_log(ic, _("No user info available."));
+			imcb_log(ic, _("No user info available."));
 		}
 	} else if(infotype == AIM_GETINFO_AWAYMESSAGE && userinfo->flags & AIM_FLAG_AWAY) {
 		utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
-		imc_log(ic, "%s\n%s", _("Away Message"), utf8);
+		imcb_log(ic, "%s\n%s", _("Away Message"), utf8);
 	}
 
Index: protocols/oscar/rxqueue.c
===================================================================
--- protocols/oscar/rxqueue.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/rxqueue.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -392,5 +392,5 @@
 		aim_bstream_rewind(&flaphdr);
 		start = aimbs_get8(&flaphdr);
-		imc_error(sess->aux_data, "FLAP framing disrupted");
+		imcb_error(sess->aux_data, "FLAP framing disrupted");
 		aim_conn_close(conn);
 		return -1;
Index: protocols/oscar/search.c
===================================================================
--- protocols/oscar/search.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/search.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -39,5 +39,5 @@
 	/* XXX the modules interface should have already retrieved this for us */
 	if (!(snac2 = aim_remsnac(sess, snac->id))) {
-		imc_error(sess->aux_data, "couldn't get snac");
+		imcb_error(sess->aux_data, "couldn't get snac");
 		return 0;
 	}
Index: protocols/oscar/service.c
===================================================================
--- protocols/oscar/service.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/service.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -567,5 +567,5 @@
 		group = aimbs_get16(bs);
 
-		imc_error(sess->aux_data, "bifurcated migration unsupported");
+		imcb_error(sess->aux_data, "bifurcated migration unsupported");
 	}
 
@@ -894,5 +894,5 @@
 */
 		} else
-			imc_error(sess->aux_data, "WARNING: unknown hash request");
+			imcb_error(sess->aux_data, "WARNING: unknown hash request");
 
 	}
Index: protocols/oscar/txqueue.c
===================================================================
--- protocols/oscar/txqueue.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/oscar/txqueue.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -30,5 +30,5 @@
 
 	if (!conn) {
-		imc_error(sess->aux_data, "no connection specified");
+		imcb_error(sess->aux_data, "no connection specified");
 		return NULL;
 	}
@@ -46,5 +46,5 @@
 
 	} else 
-		imc_error(sess->aux_data, "unknown framing");
+		imcb_error(sess->aux_data, "unknown framing");
 
 	if (datalen > 0) {
@@ -80,5 +80,5 @@
 
 	if (!fr->conn) {
-		imc_error(sess->aux_data, "WARNING: enqueueing packet with no connection");
+		imcb_error(sess->aux_data, "WARNING: enqueueing packet with no connection");
 		fr->conn = aim_getconn_type(sess, AIM_CONN_TYPE_BOS);
 	}
@@ -120,5 +120,5 @@
 
 	if (!fr->conn) {
-		imc_error(sess->aux_data, "packet has no connection");
+		imcb_error(sess->aux_data, "packet has no connection");
 		aim_frame_destroy(fr);
 		return 0;
Index: protocols/yahoo/yahoo.c
===================================================================
--- protocols/yahoo/yahoo.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ protocols/yahoo/yahoo.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -123,5 +123,5 @@
 static void byahoo_login( account_t *acc )
 {
-	struct im_connection *ic = imc_new( acc );
+	struct im_connection *ic = imcb_new( acc );
 	struct byahoo_data *yd = ic->proto_data = g_new0( struct byahoo_data, 1 );
 	
@@ -129,5 +129,5 @@
 	yd->current_status = YAHOO_STATUS_AVAILABLE;
 	
-	imc_log( ic, "Connecting" );
+	imcb_log( ic, "Connecting" );
 	yd->y2_id = yahoo_init( acc->user, acc->pass );
 	yahoo_login( yd->y2_id, yd->current_status );
@@ -163,5 +163,5 @@
 {
 	/* Just make an URL and let the user fetch the info */
-	imc_log(ic, "%s\n%s: %s%s", _("User Info"), 
+	imcb_log(ic, "%s\n%s: %s%s", _("User Info"), 
 			_("For now, fetch yourself"), yahoo_get_profile_url(),
 			who);
@@ -510,5 +510,5 @@
 	if( succ == YAHOO_LOGIN_OK )
 	{
-		imc_connected( ic );
+		imcb_connected( ic );
 		
 		yd->logged_in = TRUE;
@@ -538,7 +538,7 @@
 		
 		if( url && *url )
-			imc_error( ic, "Error %d (%s). See %s for more information.", succ, errstr, url );
+			imcb_error( ic, "Error %d (%s). See %s for more information.", succ, errstr, url );
 		else
-			imc_error( ic, "Error %d (%s)", succ, errstr );
+			imcb_error( ic, "Error %d (%s)", succ, errstr );
 		
 		imc_logout( ic, allow_reconnect );
@@ -605,5 +605,5 @@
 	struct im_connection *ic = byahoo_get_ic_by_id( id );
 	
-	imc_log( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who );
+	imcb_log( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who );
 }
 
@@ -625,5 +625,5 @@
 	struct im_connection *ic = byahoo_get_ic_by_id( id );
 	
-	imc_log( ic, "Yahoo! system message: %s", msg );
+	imcb_log( ic, "Yahoo! system message: %s", msg );
 }
 
@@ -632,5 +632,5 @@
 	struct im_connection *ic = byahoo_get_ic_by_id( id );
 	
-	imc_log( ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from );
+	imcb_log( ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from );
 }
 
@@ -639,5 +639,5 @@
 	struct im_connection *ic = byahoo_get_ic_by_id( id );
 	
-	imc_error( ic, "%s", err );
+	imcb_error( ic, "%s", err );
 	
 	if( fatal )
@@ -803,5 +803,5 @@
 	g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", room, who, msg );
 	
-	do_ask_dialog( ic, txt, inv, byahoo_accept_conf, byahoo_reject_conf );
+	imcb_ask( ic, txt, inv, byahoo_accept_conf, byahoo_reject_conf );
 }
 
@@ -810,5 +810,5 @@
 	struct im_connection *ic = byahoo_get_ic_by_id( id );
 	
-	imc_log( ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg );
+	imcb_log( ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg );
 }
 
@@ -893,7 +893,7 @@
 	
 	if( from && subj )
-		imc_log( ic, "Received e-mail message from %s with subject `%s'", from, subj );
+		imcb_log( ic, "Received e-mail message from %s with subject `%s'", from, subj );
 	else if( cnt > 0 )
-		imc_log( ic, "Received %d new e-mails", cnt );
+		imcb_log( ic, "Received %d new e-mails", cnt );
 }
 
Index: query.c
===================================================================
--- query.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ query.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -122,5 +122,5 @@
 	
 	if( count > 0 )
-		imc_log( ic, "Flushed %d unanswered question(s) for this connection.", count );
+		imcb_log( ic, "Flushed %d unanswered question(s) for this connection.", count );
 	
 	q = query_default( irc );
@@ -140,10 +140,10 @@
 	if( ans )
 	{
-		imc_log( q->ic, "Accepted: %s", q->question );
+		imcb_log( q->ic, "Accepted: %s", q->question );
 		q->yes( NULL, q->data );
 	}
 	else
 	{
-		imc_log( q->ic, "Rejected: %s", q->question );
+		imcb_log( q->ic, "Rejected: %s", q->question );
 		q->no( NULL, q->data );
 	}
@@ -160,5 +160,5 @@
 	if( q->ic )
 	{
-		imc_log( q->ic, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
+		imcb_log( q->ic, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
 	}
 	else
Index: root_commands.c
===================================================================
--- root_commands.c	(revision c2fb38096ea4e75a680e57e103d4a4986aa84c75)
+++ root_commands.c	(revision 84b045d409f1e8da6d8bf379c6fef7236dcd9bcd)
@@ -634,6 +634,6 @@
 	else
 	{
-		bim_rem_allow( ic, cmd[2] );
-		bim_add_block( ic, cmd[2] );
+		imc_rem_allow( ic, cmd[2] );
+		imc_add_block( ic, cmd[2] );
 		irc_usermsg( irc, "Buddy `%s' moved from your allow- to your block-list", cmd[2] );
 	}
@@ -693,6 +693,6 @@
 	else
 	{
-		bim_rem_block( ic, cmd[2] );
-		bim_add_allow( ic, cmd[2] );
+		imc_rem_block( ic, cmd[2] );
+		imc_add_allow( ic, cmd[2] );
 		
 		irc_usermsg( irc, "Buddy `%s' moved from your block- to your allow-list", cmd[2] );
