diff libpurple/protocols/oscar/oscar.h @ 29606:0d3145e6b1d6

Change the oscar capabilities variable to be a guint64 everywhere instead of an enum, which can be 32 bits
author Mark Doliner <mark@kingant.net>
date Thu, 18 Mar 2010 04:53:49 +0000
parents 44165d2f71d6
children 59f4012b2b94
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.h	Wed Mar 17 20:42:48 2010 +0000
+++ b/libpurple/protocols/oscar/oscar.h	Thu Mar 18 04:53:49 2010 +0000
@@ -344,44 +344,39 @@
 	OSCAR_DISCONNECT_RETRYING /* peer connections only */
 } OscarDisconnectReason;
 
-typedef enum
-{
-	OSCAR_CAPABILITY_BUDDYICON            = 0x00000001,
-	OSCAR_CAPABILITY_TALK                 = 0x00000002,
-	OSCAR_CAPABILITY_DIRECTIM             = 0x00000004,
-	OSCAR_CAPABILITY_CHAT                 = 0x00000008,
-	OSCAR_CAPABILITY_GETFILE              = 0x00000010,
-	OSCAR_CAPABILITY_SENDFILE             = 0x00000020,
-	OSCAR_CAPABILITY_GAMES                = 0x00000040,
-	OSCAR_CAPABILITY_ADDINS               = 0x00000080,
-	OSCAR_CAPABILITY_SENDBUDDYLIST        = 0x00000100,
-	OSCAR_CAPABILITY_GAMES2               = 0x00000200,
-	OSCAR_CAPABILITY_ICQ_DIRECT           = 0x00000400,
-	OSCAR_CAPABILITY_APINFO               = 0x00000800,
-	OSCAR_CAPABILITY_ICQRTF               = 0x00001000,
-	OSCAR_CAPABILITY_EMPTY                = 0x00002000,
-	OSCAR_CAPABILITY_ICQSERVERRELAY       = 0x00004000,
-	OSCAR_CAPABILITY_UNICODEOLD           = 0x00008000,
-	OSCAR_CAPABILITY_TRILLIANCRYPT        = 0x00010000,
-	OSCAR_CAPABILITY_UNICODE              = 0x00020000,
-	OSCAR_CAPABILITY_INTEROPERATE         = 0x00040000,
-	OSCAR_CAPABILITY_SHORTCAPS            = 0x00080000,
-	OSCAR_CAPABILITY_HIPTOP               = 0x00100000,
-	OSCAR_CAPABILITY_SECUREIM             = 0x00200000,
-	OSCAR_CAPABILITY_SMS                  = 0x00400000,
-	OSCAR_CAPABILITY_VIDEO                = 0x00800000,
-	OSCAR_CAPABILITY_ICHATAV              = 0x01000000,
-	OSCAR_CAPABILITY_LIVEVIDEO            = 0x02000000,
-	OSCAR_CAPABILITY_CAMERA               = 0x04000000,
-	OSCAR_CAPABILITY_ICHAT_SCREENSHARE    = 0x08000000,
-	OSCAR_CAPABILITY_TYPING               = 0x10000000,
-	OSCAR_CAPABILITY_NEWCAPS              = 0x20000000,
-	OSCAR_CAPABILITY_XTRAZ                = 0x40000000,
-	OSCAR_CAPABILITY_GENERICUNKNOWN       = 0x80000000,
-#warning Fix OSCAR_CAPABILITY_LAST situation
-	// TODO: We're out of bits.  Rework things that depend on this or remove some capability. (Or, ensure this is a 64-bit type.)
-	OSCAR_CAPABILITY_LAST                 = 0x100000000	
-} OscarCapability;
+#define OSCAR_CAPABILITY_BUDDYICON             0x0000000000000001
+#define OSCAR_CAPABILITY_TALK                  0x0000000000000002
+#define OSCAR_CAPABILITY_DIRECTIM              0x0000000000000004
+#define OSCAR_CAPABILITY_CHAT                  0x0000000000000008
+#define OSCAR_CAPABILITY_GETFILE               0x0000000000000010
+#define OSCAR_CAPABILITY_SENDFILE              0x0000000000000020
+#define OSCAR_CAPABILITY_GAMES                 0x0000000000000040
+#define OSCAR_CAPABILITY_ADDINS                0x0000000000000080
+#define OSCAR_CAPABILITY_SENDBUDDYLIST         0x0000000000000100
+#define OSCAR_CAPABILITY_GAMES2                0x0000000000000200
+#define OSCAR_CAPABILITY_ICQ_DIRECT            0x0000000000000400
+#define OSCAR_CAPABILITY_APINFO                0x0000000000000800
+#define OSCAR_CAPABILITY_ICQRTF                0x0000000000001000
+#define OSCAR_CAPABILITY_EMPTY                 0x0000000000002000
+#define OSCAR_CAPABILITY_ICQSERVERRELAY        0x0000000000004000
+#define OSCAR_CAPABILITY_UNICODEOLD            0x0000000000008000
+#define OSCAR_CAPABILITY_TRILLIANCRYPT         0x0000000000010000
+#define OSCAR_CAPABILITY_UNICODE               0x0000000000020000
+#define OSCAR_CAPABILITY_INTEROPERATE          0x0000000000040000
+#define OSCAR_CAPABILITY_SHORTCAPS             0x0000000000080000
+#define OSCAR_CAPABILITY_HIPTOP                0x0000000000100000
+#define OSCAR_CAPABILITY_SECUREIM              0x0000000000200000
+#define OSCAR_CAPABILITY_SMS                   0x0000000000400000
+#define OSCAR_CAPABILITY_VIDEO                 0x0000000000800000
+#define OSCAR_CAPABILITY_ICHATAV               0x0000000001000000
+#define OSCAR_CAPABILITY_LIVEVIDEO             0x0000000002000000
+#define OSCAR_CAPABILITY_CAMERA                0x0000000004000000
+#define OSCAR_CAPABILITY_ICHAT_SCREENSHARE     0x0000000008000000
+#define OSCAR_CAPABILITY_TYPING                0x0000000010000000
+#define OSCAR_CAPABILITY_NEWCAPS               0x0000000020000000
+#define OSCAR_CAPABILITY_XTRAZ                 0x0000000040000000
+#define OSCAR_CAPABILITY_GENERICUNKNOWN        0x0000000080000000
+#define OSCAR_CAPABILITY_LAST                  0x0000000100000000
 
 /*
  * Byte Stream type. Sort of.
@@ -1077,7 +1072,7 @@
 	guint32 membersince; /* time_t */
 	guint32 onlinesince; /* time_t */
 	guint32 sessionlen;  /* in seconds */
-	guint32 capabilities;
+	guint64 capabilities;
 	struct {
 		guint32 status;
 		guint32 ipaddr;
@@ -1142,7 +1137,7 @@
 void aim_locate_dorequest(OscarData *od);
 
 /* 0x0002 */ int aim_locate_reqrights(OscarData *od);
-/* 0x0004 */ int aim_locate_setcaps(OscarData *od, guint32 caps);
+/* 0x0004 */ int aim_locate_setcaps(OscarData *od, guint64 caps);
 /* 0x0004 */ int aim_locate_setprofile(OscarData *od, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len);
 /* 0x0005 */ int aim_locate_getinfo(OscarData *od, const char *, guint16);
 /* 0x0009 */ int aim_locate_setdirinfo(OscarData *od, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, guint16 privacy);
@@ -1150,8 +1145,8 @@
 /* 0x000f */ int aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy);
 /* 0x0015 */ int aim_locate_getinfoshort(OscarData *od, const char *bn, guint32 flags);
 
-guint32 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len);
-guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len);
+guint64 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len);
+guint64 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len);
 void aim_info_free(aim_userinfo_t *);
 int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *);
 int aim_putuserinfo(ByteStream *bs, aim_userinfo_t *info);
@@ -1487,7 +1482,7 @@
 int aim_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value);
 int aim_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value);
 int aim_tlvlist_add_str(GSList **list, const guint16 type, const char *value);
-int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint32 caps, const char *mood);
+int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint64 caps, const char *mood);
 int aim_tlvlist_add_userinfo(GSList **list, guint16 type, aim_userinfo_t *userinfo);
 int aim_tlvlist_add_chatroom(GSList **list, guint16 type, guint16 exchange, const char *roomname, guint16 instance);
 int aim_tlvlist_add_frozentlvlist(GSList **list, guint16 type, GSList **tl);
@@ -1650,7 +1645,7 @@
 int byte_stream_putstr(ByteStream *bs, const char *str);
 int byte_stream_putbs(ByteStream *bs, ByteStream *srcbs, int len);
 int byte_stream_putuid(ByteStream *bs, OscarData *od);
-int byte_stream_putcaps(ByteStream *bs, guint32 caps);
+int byte_stream_putcaps(ByteStream *bs, guint64 caps);
 
 /**
  * Inserts a BART asset block into the given byte stream.  The flags