Index: protocols/oscar/aim.h
===================================================================
--- protocols/oscar/aim.h	(revision 6042a54e827b36770e8989d9a8ba49a66ec6f846)
+++ protocols/oscar/aim.h	(revision 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11)
@@ -1,3 +1,3 @@
-/* 
+/*
  * Main libfaim header.  Must be included in client for prototypes/macros.
  *
@@ -29,9 +29,9 @@
 
 #if defined(mach) && defined(__APPLE__)
-#define gethostbyname(x) gethostbyname2(x, AF_INET) 
+#define gethostbyname(x) gethostbyname2(x, AF_INET)
 #endif
 
-/* 
- * Current Maximum Length for Screen Names (not including NULL) 
+/*
+ * Current Maximum Length for Screen Names (not including NULL)
  *
  * Currently only names up to 16 characters can be registered
@@ -53,5 +53,5 @@
  *
  * XXX: the real limit is the total SNAC size at 8192. Fix this.
- * 
+ *
  */
 #define MAXMSGLEN 7987
@@ -67,5 +67,5 @@
  *
  * This is actually defined by the protocol to be
- * dynamic, but I have yet to see due cause to 
+ * dynamic, but I have yet to see due cause to
  * define it dynamically here.  Maybe later.
  *
@@ -81,8 +81,8 @@
 
 /*
- * Default Authorizer server name and TCP port for the OSCAR farm.  
+ * Default Authorizer server name and TCP port for the OSCAR farm.
  *
  * You shouldn't need to change this unless you're writing
- * your own server. 
+ * your own server.
  *
  * Note that only one server is needed to start the whole
@@ -107,5 +107,5 @@
 
 /*
- * Client info.  Filled in by the client and passed in to 
+ * Client info.  Filled in by the client and passed in to
  * aim_send_login().  The information ends up getting passed to OSCAR
  * through the initial login command.
@@ -124,42 +124,42 @@
 
 #define AIM_CLIENTINFO_KNOWNGOOD_3_5_1670 { \
-	"AOL Instant Messenger (SM), version 3.5.1670/WIN32", \
-	0x0004, \
-	0x0003, \
-	0x0005, \
-	0x0000, \
-	0x0686, \
-	"us", \
-	"en", \
+		"AOL Instant Messenger (SM), version 3.5.1670/WIN32", \
+		0x0004, \
+		0x0003, \
+		0x0005, \
+		0x0000, \
+		0x0686, \
+		"us", \
+		"en", \
 }
 
 #define AIM_CLIENTINFO_KNOWNGOOD_4_1_2010 { \
-	  "AOL Instant Messenger (SM), version 4.1.2010/WIN32", \
-	  0x0004, \
-	  0x0004, \
-	  0x0001, \
-	  0x0000, \
-	  0x07da, \
-	  "us", \
-	  "en", \
+		"AOL Instant Messenger (SM), version 4.1.2010/WIN32", \
+		0x0004, \
+		0x0004, \
+		0x0001, \
+		0x0000, \
+		0x07da, \
+		"us", \
+		"en", \
 }
 
 #define AIM_CLIENTINFO_KNOWNGOOD_5_1_3036 { \
-	"AOL Instant Messenger, version 5.1.3036/WIN32", \
-	0x0109, \
-	0x0005, \
-	0x0001, \
-	0x0000, \
-	0x0bdc, \
-	"us", \
-	"en", \
+		"AOL Instant Messenger, version 5.1.3036/WIN32", \
+		0x0109, \
+		0x0005, \
+		0x0001, \
+		0x0000, \
+		0x0bdc, \
+		"us", \
+		"en", \
 }
 
 /*
  * I would make 4.1.2010 the default, but they seem to have found
- * an alternate way of breaking that one. 
+ * an alternate way of breaking that one.
  *
  * 3.5.1670 should work fine, however, you will be subjected to the
- * memory test, which may require you to have a WinAIM binary laying 
+ * memory test, which may require you to have a WinAIM binary laying
  * around. (see login.c::memrequest())
  */
@@ -171,6 +171,6 @@
 #endif
 
-/* 
- * These could be arbitrary, but its easier to use the actual AIM values 
+/*
+ * These could be arbitrary, but its easier to use the actual AIM values
  */
 #define AIM_CONN_TYPE_AUTH          0x0007
@@ -207,9 +207,9 @@
 #define AIM_MTYPE_CONTACTS  0x13
 #define AIM_MTYPE_PLUGIN    0x1A
-#define AIM_MTYPE_AUTOAWAY	0xE8
-#define AIM_MTYPE_AUTOBUSY	0xE9
-#define AIM_MTYPE_AUTONA	0xEA
-#define AIM_MTYPE_AUTODND	0xEB
-#define AIM_MTYPE_AUTOFFC	0xEC
+#define AIM_MTYPE_AUTOAWAY      0xE8
+#define AIM_MTYPE_AUTOBUSY      0xE9
+#define AIM_MTYPE_AUTONA        0xEA
+#define AIM_MTYPE_AUTODND       0xEB
+#define AIM_MTYPE_AUTOFFC       0xEC
 
 typedef struct aim_conn_s {
@@ -222,5 +222,5 @@
 	void *internal; /* internal conn-specific libfaim data */
 	time_t lastactivity; /* time of last transmit */
-	int forcedlatency; 
+	int forcedlatency;
 	void *handlerlist;
 	void *sessv; /* pointer to parent session */
@@ -252,12 +252,12 @@
 	guint8 hdrtype; /* defines which piece of the union to use */
 	union {
-		struct { 
+		struct {
 			guint8 type;
-			flap_seqnum_t seqnum;     
+			flap_seqnum_t seqnum;
 		} flap;
 	} hdr;
-	aim_bstream_t data;	/* payload stream */
-	guint8 handled;		/* 0 = new, !0 = been handled */
-	guint8 nofree;		/* 0 = free data on purge, 1 = only unlink */
+	aim_bstream_t data;     /* payload stream */
+	guint8 handled;         /* 0 = new, !0 = been handled */
+	guint8 nofree;          /* 0 = free data on purge, 1 = only unlink */
 	aim_conn_t *conn;  /* the connection it came in on... */
 	struct aim_frame_s *next;
@@ -273,5 +273,5 @@
 
 /*
- * AIM Session: The main client-data interface.  
+ * AIM Session: The main client-data interface.
  *
  */
@@ -281,8 +281,8 @@
 
 	/* Our screen name. */
-	char sn[MAXSNLEN+1];
+	char sn[MAXSNLEN + 1];
 
 	/*
-	 * Pointer to anything the client wants to 
+	 * Pointer to anything the client wants to
 	 * explicitly associate with this session.
 	 *
@@ -314,8 +314,8 @@
 	 * I/O.  I don't suggest that you use libfaim's internal I/O.
 	 * Its really bad and the API/event model is quirky at best.
-	 *  
+	 *
 	 */
-	aim_frame_t *queue_outgoing;   
-	aim_frame_t *queue_incoming; 
+	aim_frame_t *queue_outgoing;
+	aim_frame_t *queue_incoming;
 
 	/*
@@ -330,5 +330,5 @@
 
 	/*
-	 * Outstanding snac handling 
+	 * Outstanding snac handling
 	 *
 	 * XXX: Should these be per-connection? -mid
@@ -384,5 +384,5 @@
  */
 typedef struct {
-	char sn[MAXSNLEN+1];
+	char sn[MAXSNLEN + 1];
 	guint16 warnlevel;
 	guint16 idletime;
@@ -390,5 +390,5 @@
 	guint32 membersince;
 	guint32 onlinesince;
-	guint32 sessionlen; 
+	guint32 sessionlen;
 	guint32 capabilities;
 	struct {
@@ -410,19 +410,19 @@
 #define AIM_USERINFO_PRESENT_SESSIONLEN   0x00000100
 
-#define AIM_FLAG_UNCONFIRMED 	0x0001 /* "damned transients" */
-#define AIM_FLAG_ADMINISTRATOR	0x0002
-#define AIM_FLAG_AOL		0x0004
-#define AIM_FLAG_OSCAR_PAY	0x0008
-#define AIM_FLAG_FREE 		0x0010
-#define AIM_FLAG_AWAY		0x0020
-#define AIM_FLAG_ICQ		0x0040
-#define AIM_FLAG_WIRELESS	0x0080
-#define AIM_FLAG_UNKNOWN100	0x0100
-#define AIM_FLAG_UNKNOWN200	0x0200
+#define AIM_FLAG_UNCONFIRMED    0x0001 /* "damned transients" */
+#define AIM_FLAG_ADMINISTRATOR  0x0002
+#define AIM_FLAG_AOL            0x0004
+#define AIM_FLAG_OSCAR_PAY      0x0008
+#define AIM_FLAG_FREE           0x0010
+#define AIM_FLAG_AWAY           0x0020
+#define AIM_FLAG_ICQ            0x0040
+#define AIM_FLAG_WIRELESS       0x0080
+#define AIM_FLAG_UNKNOWN100     0x0100
+#define AIM_FLAG_UNKNOWN200     0x0200
 #define AIM_FLAG_ACTIVEBUDDY    0x0400
-#define AIM_FLAG_UNKNOWN800	0x0800
+#define AIM_FLAG_UNKNOWN800     0x0800
 #define AIM_FLAG_ABINTERNAL     0x1000
 
-#define AIM_FLAG_ALLUSERS	0x001f
+#define AIM_FLAG_ALLUSERS       0x001f
 
 /*
@@ -468,5 +468,6 @@
 int aim_addtlvtochain_caps(aim_tlvlist_t **list, const guint16 t, const guint32 caps);
 int aim_addtlvtochain_noval(aim_tlvlist_t **list, const guint16 type);
-int aim_addtlvtochain_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance);
+int aim_addtlvtochain_chatroom(aim_tlvlist_t **list, guint16 type, guint16 exchange, const char *roomname,
+                               guint16 instance);
 int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, guint16 type, aim_userinfo_t *ui);
 int aim_addtlvtochain_frozentlvlist(aim_tlvlist_t **list, guint16 type, aim_tlvlist_t **tl);
@@ -543,5 +544,6 @@
 void aim_conn_kill(aim_session_t *sess, aim_conn_t **deadconn);
 
-int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, u_short family, u_short type, aim_rxcallback_t newhandler, u_short flags);
+int aim_conn_addhandler(aim_session_t *, aim_conn_t *conn, u_short family, u_short type, aim_rxcallback_t newhandler,
+                        u_short flags);
 int aim_clearhandlers(aim_conn_t *conn);
 
@@ -558,5 +560,5 @@
 
 typedef void (*faim_debugging_callback_t)(aim_session_t *sess, int level, const char *format, va_list va);
-int aim_setdebuggingcb(aim_session_t *sess, faim_debugging_callback_t);
+int aim_setdebuggingcb(aim_session_t * sess, faim_debugging_callback_t);
 void aim_session_init(aim_session_t *, guint32 flags, int debuglevel);
 void aim_session_kill(aim_session_t *);
@@ -618,5 +620,6 @@
 /* aim_im.c */
 
-aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, guint16 numfiles, guint32 totsize);
+aim_conn_t *aim_sendfile_initiate(aim_session_t *, const char *destsn, const char *filename, guint16 numfiles,
+                                  guint32 totsize);
 
 aim_conn_t *aim_getfile_initiate(aim_session_t *sess, aim_conn_t *conn, const char *destsn);
@@ -653,27 +656,29 @@
 #define AIM_TRANSFER_DENY_DECLINE 0x0001
 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002
-aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const guint8 *cookie, const guint8 *ip, guint16 listingfiles, guint16 listingtotsize, guint16 listingsize, guint32 listingchecksum, guint16 rendid);
+aim_conn_t *aim_accepttransfer(aim_session_t *sess, aim_conn_t *conn, const char *sn, const guint8 *cookie,
+                               const guint8 *ip, guint16 listingfiles, guint16 listingtotsize, guint16 listingsize,
+                               guint32 listingchecksum, guint16 rendid);
 
 int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, unsigned short);
 
-#define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED	0x00000001
-#define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED	0x00000002
+#define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED       0x00000001
+#define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED    0x00000002
 
 /* This is what the server will give you if you don't set them yourself. */
 #define AIM_IMPARAM_DEFAULTS { \
-	0, \
-	AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
-	512, /* !! Note how small this is. */ \
-	(99.9)*10, (99.9)*10, \
-	1000 /* !! And how large this is. */ \
+		0, \
+		AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
+		512, /* !! Note how small this is. */ \
+		(99.9) * 10, (99.9) * 10, \
+		1000 /* !! And how large this is. */ \
 }
 
 /* This is what most AIM versions use. */
 #define AIM_IMPARAM_REASONABLE { \
-	0, \
-	AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
-	8000, \
-	(99.9)*10, (99.9)*10, \
-	0 \
+		0, \
+		AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \
+		8000, \
+		(99.9) * 10, (99.9) * 10, \
+		0 \
 }
 
@@ -716,8 +721,8 @@
 };
 
-#define AIM_CHATFLAGS_NOREFLECT 	0x0001
-#define AIM_CHATFLAGS_AWAY      	0x0002
-#define AIM_CHATFLAGS_UNICODE		0x0004
-#define AIM_CHATFLAGS_ISO_8859_1	0x0008
+#define AIM_CHATFLAGS_NOREFLECT         0x0001
+#define AIM_CHATFLAGS_AWAY              0x0002
+#define AIM_CHATFLAGS_UNICODE           0x0004
+#define AIM_CHATFLAGS_ISO_8859_1        0x0008
 
 int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const char *msg, int msglen);
@@ -726,5 +731,6 @@
 int aim_chatnav_reqrights(aim_session_t *sess, aim_conn_t *conn);
 
-int aim_chat_invite(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *msg, guint16 exchange, const char *roomname, guint16 instance);
+int aim_chat_invite(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *msg, guint16 exchange,
+                    const char *roomname, guint16 instance);
 
 int aim_chatnav_createroom(aim_session_t *sess, aim_conn_t *conn, const char *name, guint16 exchange);
@@ -738,48 +744,48 @@
  *
  */
-#define aimutil_put8(buf, data) ((*(buf) = (u_char)(data)&0xff),1)
-#define aimutil_get8(buf) ((*(buf))&0xff)
+#define aimutil_put8(buf, data) ((*(buf) = (u_char) (data) & 0xff), 1)
+#define aimutil_get8(buf) ((*(buf)) & 0xff)
 #define aimutil_put16(buf, data) ( \
-		(*(buf) = (u_char)((data)>>8)&0xff), \
-		(*((buf)+1) = (u_char)(data)&0xff),  \
-		2)
-#define aimutil_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff))
+	        (*(buf) = (u_char) ((data) >> 8) & 0xff), \
+	        (*((buf) + 1) = (u_char) (data) & 0xff),  \
+	        2)
+#define aimutil_get16(buf) ((((*(buf)) << 8) & 0xff00) + ((*((buf) + 1)) & 0xff))
 #define aimutil_put32(buf, data) ( \
-		(*((buf)) = (u_char)((data)>>24)&0xff), \
-		(*((buf)+1) = (u_char)((data)>>16)&0xff), \
-		(*((buf)+2) = (u_char)((data)>>8)&0xff), \
-		(*((buf)+3) = (u_char)(data)&0xff), \
-		4)
-#define aimutil_get32(buf) ((((*(buf))<<24)&0xff000000) + \
-		(((*((buf)+1))<<16)&0x00ff0000) + \
-		(((*((buf)+2))<< 8)&0x0000ff00) + \
-		(((*((buf)+3)    )&0x000000ff)))
+	        (*((buf)) = (u_char) ((data) >> 24) & 0xff), \
+	        (*((buf) + 1) = (u_char) ((data) >> 16) & 0xff), \
+	        (*((buf) + 2) = (u_char) ((data) >> 8) & 0xff), \
+	        (*((buf) + 3) = (u_char) (data) & 0xff), \
+	        4)
+#define aimutil_get32(buf) ((((*(buf)) << 24) & 0xff000000) + \
+	                    (((*((buf) + 1)) << 16) & 0x00ff0000) + \
+	                    (((*((buf) + 2)) << 8) & 0x0000ff00) + \
+	                    (((*((buf) + 3)) & 0x000000ff)))
 
 /* Little-endian versions (damn ICQ) */
 #define aimutil_putle8(buf, data) ( \
-		(*(buf) = (unsigned char)(data) & 0xff), \
-		1)
+	        (*(buf) = (unsigned char) (data) & 0xff), \
+	        1)
 #define aimutil_getle8(buf) ( \
-		(*(buf)) & 0xff \
-		)
+	        (*(buf)) & 0xff \
+	        )
 #define aimutil_putle16(buf, data) ( \
-		(*((buf)+0) = (unsigned char)((data) >> 0) & 0xff),  \
-		(*((buf)+1) = (unsigned char)((data) >> 8) & 0xff), \
-		2)
+	        (*((buf) + 0) = (unsigned char) ((data) >> 0) & 0xff),  \
+	        (*((buf) + 1) = (unsigned char) ((data) >> 8) & 0xff), \
+	        2)
 #define aimutil_getle16(buf) ( \
-		(((*((buf)+0)) << 0) & 0x00ff) + \
-		(((*((buf)+1)) << 8) & 0xff00) \
-		)
+	        (((*((buf) + 0)) << 0) & 0x00ff) + \
+	        (((*((buf) + 1)) << 8) & 0xff00) \
+	        )
 #define aimutil_putle32(buf, data) ( \
-		(*((buf)+0) = (unsigned char)((data) >>  0) & 0xff), \
-		(*((buf)+1) = (unsigned char)((data) >>  8) & 0xff), \
-		(*((buf)+2) = (unsigned char)((data) >> 16) & 0xff), \
-		(*((buf)+3) = (unsigned char)((data) >> 24) & 0xff), \
-		4)
+	        (*((buf) + 0) = (unsigned char) ((data) >>  0) & 0xff), \
+	        (*((buf) + 1) = (unsigned char) ((data) >>  8) & 0xff), \
+	        (*((buf) + 2) = (unsigned char) ((data) >> 16) & 0xff), \
+	        (*((buf) + 3) = (unsigned char) ((data) >> 24) & 0xff), \
+	        4)
 #define aimutil_getle32(buf) ( \
-		(((*((buf)+0)) <<  0) & 0x000000ff) + \
-		(((*((buf)+1)) <<  8) & 0x0000ff00) + \
-		(((*((buf)+2)) << 16) & 0x00ff0000) + \
-		(((*((buf)+3)) << 24) & 0xff000000))
+	        (((*((buf) + 0)) <<  0) & 0x000000ff) + \
+	        (((*((buf) + 1)) <<  8) & 0x0000ff00) + \
+	        (((*((buf) + 2)) << 16) & 0x00ff0000) + \
+	        (((*((buf) + 3)) << 24) & 0xff000000))
 
 
@@ -797,5 +803,5 @@
 /*
  * SNAC Family: Ack.
- * 
+ *
  * Not really a family, but treating it as one really
  * helps it fit into the libfaim callback structure better.
@@ -806,5 +812,5 @@
 /*
  * SNAC Family: General.
- */ 
+ */
 #define AIM_CB_GEN_ERROR 0x0001
 #define AIM_CB_GEN_CLIENTREADY 0x0002
@@ -831,5 +837,5 @@
 /*
  * SNAC Family: Advertisement Services
- */ 
+ */
 #define AIM_CB_ADS_ERROR 0x0001
 #define AIM_CB_ADS_DEFAULT 0xffff
@@ -840,5 +846,5 @@
  * See non-SNAC note below.
  */
-#define AIM_CB_OFT_DIRECTIMCONNECTREQ 0x0001/* connect request -- actually an OSCAR CAP*/
+#define AIM_CB_OFT_DIRECTIMCONNECTREQ 0x0001 /* connect request -- actually an OSCAR CAP*/
 #define AIM_CB_OFT_DIRECTIMINCOMING 0x0002
 #define AIM_CB_OFT_DIRECTIMDISCONNECT 0x0003
@@ -869,5 +875,5 @@
  * the SNAC-centered libfaim callback structure.
  *
- */ 
+ */
 #define AIM_CB_SPECIAL_AUTHSUCCESS 0x0001
 #define AIM_CB_SPECIAL_AUTHOTHER 0x0002
