Index: protocols/msn/msn.h
===================================================================
--- protocols/msn/msn.h	(revision 6f10697380c620065731a5beece95c0f5bd652a0)
+++ protocols/msn/msn.h	(revision 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11)
@@ -1,3 +1,3 @@
-  /********************************************************************\
+/********************************************************************\
   * BitlBee -- An IRC to other IM-networks gateway                     *
   *                                                                    *
@@ -35,7 +35,7 @@
 
 #ifdef DEBUG_MSN
-#define debug( text... ) imcb_log( ic, text );
+#define debug(text ...) imcb_log(ic, text);
 #else
-#define debug( text... )
+#define debug(text ...)
 #endif
 
@@ -69,28 +69,27 @@
 
 #define MSN_MESSAGE_HEADERS "MIME-Version: 1.0\r\n" \
-                            "Content-Type: text/plain; charset=UTF-8\r\n" \
-                            "User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \
-                            "X-MMS-IM-Format: FN=MS%20Shell%20Dlg; EF=; CO=0; CS=0; PF=0\r\n" \
-                            "\r\n"
+	"Content-Type: text/plain; charset=UTF-8\r\n" \
+	"User-Agent: BitlBee " BITLBEE_VERSION "\r\n" \
+	"X-MMS-IM-Format: FN=MS%20Shell%20Dlg; EF=; CO=0; CS=0; PF=0\r\n" \
+	"\r\n"
 
 #define MSN_TYPING_HEADERS "MIME-Version: 1.0\r\n" \
-                           "Content-Type: text/x-msmsgscontrol\r\n" \
-                           "TypingUser: %s\r\n" \
-                           "\r\n\r\n"
+	"Content-Type: text/x-msmsgscontrol\r\n" \
+	"TypingUser: %s\r\n" \
+	"\r\n\r\n"
 
 #define MSN_NUDGE_HEADERS "MIME-Version: 1.0\r\n" \
-			  "Content-Type: text/x-msnmsgr-datacast\r\n" \
-			  "\r\n" \
-			  "ID: 1\r\n" \
-			  "\r\n"
+	"Content-Type: text/x-msnmsgr-datacast\r\n" \
+	"\r\n" \
+	"ID: 1\r\n" \
+	"\r\n"
 
 #define MSN_SB_KEEPALIVE_HEADERS "MIME-Version: 1.0\r\n" \
-                                 "Content-Type: text/x-ping\r\n" \
-                                 "\r\n\r\n"
+	"Content-Type: text/x-ping\r\n" \
+	"\r\n\r\n"
 
 #define PROFILE_URL "http://members.msn.com/"
 
-typedef enum
-{
+typedef enum {
 	MSN_GOT_PROFILE = 1,
 	MSN_GOT_PROFILE_DN = 2,
@@ -100,41 +99,39 @@
 } msn_flags_t;
 
-struct msn_handler_data
-{
+struct msn_handler_data {
 	int fd, inpa;
 	int rxlen;
 	char *rxq;
-	
+
 	int msglen;
 	char *cmd_text;
-	
+
 	/* Either ic or sb */
 	gpointer data;
-	
-	int (*exec_command) ( struct msn_handler_data *handler, char **cmd, int count );
-	int (*exec_message) ( struct msn_handler_data *handler, char *msg, int msglen, char **cmd, int count );
-};
-
-struct msn_data
-{
+
+	int (*exec_command) (struct msn_handler_data *handler, char **cmd, int count);
+	int (*exec_message) (struct msn_handler_data *handler, char *msg, int msglen, char **cmd, int count);
+};
+
+struct msn_data {
 	struct im_connection *ic;
-	
+
 	struct msn_handler_data ns[1];
 	msn_flags_t flags;
-	
+
 	int trId;
 	char *tokens[4];
 	char *lock_key, *pp_policy;
 	char *uuid;
-	
+
 	GSList *msgq, *grpq, *soapq;
 	GSList *switchboards;
 	int sb_failures;
 	time_t first_sb_failure;
-	
+
 	const struct msn_away_state *away_state;
 	GSList *groups;
 	char *profile_rid;
-	
+
 	/* Mostly used for sending the ADL command; since MSNP13 the client
 	   is responsible for downloading the contact list and then sending
@@ -144,8 +141,7 @@
 };
 
-struct msn_switchboard
-{
+struct msn_switchboard {
 	struct im_connection *ic;
-	
+
 	/* The following two are also in the handler. TODO: Clean up. */
 	int fd;
@@ -153,11 +149,11 @@
 	struct msn_handler_data *handler;
 	gint keepalive;
-	
+
 	int trId;
 	int ready;
-	
+
 	int session;
 	char *key;
-	
+
 	GSList *msgq;
 	char *who;
@@ -165,12 +161,10 @@
 };
 
-struct msn_away_state
-{
+struct msn_away_state {
 	char code[4];
 	char name[16];
 };
 
-struct msn_status_code
-{
+struct msn_status_code {
 	int number;
 	char *text;
@@ -178,18 +172,15 @@
 };
 
-struct msn_message
-{
+struct msn_message {
 	char *who;
 	char *text;
 };
 
-struct msn_groupadd
-{
+struct msn_groupadd {
 	char *who;
 	char *group;
 };
 
-typedef enum
-{
+typedef enum {
 	MSN_BUDDY_FL = 1,   /* Warning: FL,AL,BL *must* be 1,2,4. */
 	MSN_BUDDY_AL = 2,
@@ -201,12 +192,10 @@
 } msn_buddy_flags_t;
 
-struct msn_buddy_data
-{
+struct msn_buddy_data {
 	char *cid;
 	msn_buddy_flags_t flags;
 };
 
-struct msn_group
-{
+struct msn_group {
 	char *name;
 	char *id;
@@ -216,6 +205,6 @@
 #define STATUS_FATAL            1
 #define STATUS_SB_FATAL         2
-#define STATUS_SB_IM_SPARE	4	/* Make one-to-one conversation switchboard available again, invite failed. */
-#define STATUS_SB_CHAT_SPARE	8	/* Same, but also for groupchats (not used yet). */
+#define STATUS_SB_IM_SPARE      4       /* Make one-to-one conversation switchboard available again, invite failed. */
+#define STATUS_SB_CHAT_SPARE    8       /* Same, but also for groupchats (not used yet). */
 
 extern int msn_chat_id;
@@ -232,46 +221,47 @@
 
 /* ns.c */
-int msn_ns_write( struct im_connection *ic, int fd, const char *fmt, ... ) G_GNUC_PRINTF( 3, 4 );
-gboolean msn_ns_connect( struct im_connection *ic, struct msn_handler_data *handler, const char *host, int port );
-void msn_ns_close( struct msn_handler_data *handler );
-void msn_auth_got_passport_token( struct im_connection *ic, const char *token, const char *error );
-void msn_auth_got_contact_list( struct im_connection *ic );
-int msn_ns_finish_login( struct im_connection *ic );
-int msn_ns_sendmessage( struct im_connection *ic, struct bee_user *bu, const char *text );
-void msn_ns_oim_send_queue( struct im_connection *ic, GSList **msgq );
+int msn_ns_write(struct im_connection *ic, int fd, const char *fmt, ...) G_GNUC_PRINTF(3, 4);
+gboolean msn_ns_connect(struct im_connection *ic, struct msn_handler_data *handler, const char *host, int port);
+void msn_ns_close(struct msn_handler_data *handler);
+void msn_auth_got_passport_token(struct im_connection *ic, const char *token, const char *error);
+void msn_auth_got_contact_list(struct im_connection *ic);
+int msn_ns_finish_login(struct im_connection *ic);
+int msn_ns_sendmessage(struct im_connection *ic, struct bee_user *bu, const char *text);
+void msn_ns_oim_send_queue(struct im_connection *ic, GSList **msgq);
 
 /* msn_util.c */
-int msn_buddy_list_add( struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *realname_, const char *group );
-int msn_buddy_list_remove( struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *group );
-void msn_buddy_ask( bee_user_t *bu );
-char **msn_linesplit( char *line );
-int msn_handler( struct msn_handler_data *h );
-void msn_msgq_purge( struct im_connection *ic, GSList **list );
-char *msn_p11_challenge( char *challenge );
-gint msn_domaintree_cmp( gconstpointer a_, gconstpointer b_ );
-struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name );
-struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id );
-int msn_ns_set_display_name( struct im_connection *ic, const char *value );
-const char *msn_normalize_handle( const char *handle );
+int msn_buddy_list_add(struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *realname_,
+                       const char *group);
+int msn_buddy_list_remove(struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *group);
+void msn_buddy_ask(bee_user_t *bu);
+char **msn_linesplit(char *line);
+int msn_handler(struct msn_handler_data *h);
+void msn_msgq_purge(struct im_connection *ic, GSList **list);
+char *msn_p11_challenge(char *challenge);
+gint msn_domaintree_cmp(gconstpointer a_, gconstpointer b_);
+struct msn_group *msn_group_by_name(struct im_connection *ic, const char *name);
+struct msn_group *msn_group_by_id(struct im_connection *ic, const char *id);
+int msn_ns_set_display_name(struct im_connection *ic, const char *value);
+const char *msn_normalize_handle(const char *handle);
 
 /* tables.c */
-const struct msn_away_state *msn_away_state_by_number( int number );
-const struct msn_away_state *msn_away_state_by_code( char *code );
-const struct msn_away_state *msn_away_state_by_name( char *name );
-const struct msn_status_code *msn_status_by_number( int number );
+const struct msn_away_state *msn_away_state_by_number(int number);
+const struct msn_away_state *msn_away_state_by_code(char *code);
+const struct msn_away_state *msn_away_state_by_name(char *name);
+const struct msn_status_code *msn_status_by_number(int number);
 
 /* sb.c */
-int msn_sb_write( struct msn_switchboard *sb, const char *fmt, ... ) G_GNUC_PRINTF( 2, 3 );;
-struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session );
-struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, const char *handle );
-struct msn_switchboard *msn_sb_by_chat( struct groupchat *c );
-struct msn_switchboard *msn_sb_spare( struct im_connection *ic );
-int msn_sb_sendmessage( struct msn_switchboard *sb, char *text );
-struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb );
-void msn_sb_destroy( struct msn_switchboard *sb );
-gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond );
-int msn_sb_write_msg( struct im_connection *ic, struct msn_message *m );
-void msn_sb_start_keepalives( struct msn_switchboard *sb, gboolean initial );
-void msn_sb_stop_keepalives( struct msn_switchboard *sb );
+int msn_sb_write(struct msn_switchboard *sb, const char *fmt, ...) G_GNUC_PRINTF(2, 3);;
+struct msn_switchboard *msn_sb_create(struct im_connection *ic, char *host, int port, char *key, int session);
+struct msn_switchboard *msn_sb_by_handle(struct im_connection *ic, const char *handle);
+struct msn_switchboard *msn_sb_by_chat(struct groupchat *c);
+struct msn_switchboard *msn_sb_spare(struct im_connection *ic);
+int msn_sb_sendmessage(struct msn_switchboard *sb, char *text);
+struct groupchat *msn_sb_to_chat(struct msn_switchboard *sb);
+void msn_sb_destroy(struct msn_switchboard *sb);
+gboolean msn_sb_connected(gpointer data, gint source, b_input_condition cond);
+int msn_sb_write_msg(struct im_connection *ic, struct msn_message *m);
+void msn_sb_start_keepalives(struct msn_switchboard *sb, gboolean initial);
+void msn_sb_stop_keepalives(struct msn_switchboard *sb);
 
 #endif //_MSN_H
