pidgin: 28c31e70: The type and length of the TLV are only ...

qulogic at pidgin.im qulogic at pidgin.im
Sat May 7 04:51:34 EDT 2011


----------------------------------------------------------------------
Revision: 28c31e70d553b83fa9879c82e3c3308ea281d268
Parent:   740c1611544eded7957f4598c24d36cabbec1d98
Author:   qulogic at pidgin.im
Date:     05/07/11 03:14:48
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/28c31e70d553b83fa9879c82e3c3308ea281d268

Changelog: 

The type and length of the TLV are only bytes, so fix the function
declarations and definitions.

Changes against parent 740c1611544eded7957f4598c24d36cabbec1d98

  patched  libpurple/protocols/msn/tlv.c
  patched  libpurple/protocols/msn/tlv.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/tlv.c	d9b98b49c632f6426b0e848d1a3444d91e80a034
+++ libpurple/protocols/msn/tlv.c	8233a38940c13ad8d13b6534e75f04d486f50513
@@ -169,7 +169,7 @@ int
 }
 
 int
-msn_tlvlist_add_raw(GSList **list, const guint16 type, const guint16 length, const char *value)
+msn_tlvlist_add_raw(GSList **list, const guint8 type, const guint8 length, const char *value)
 {
 	msn_tlv_t *tlv;
 
@@ -186,7 +186,7 @@ int
 }
 
 int
-msn_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value)
+msn_tlvlist_add_8(GSList **list, const guint8 type, const guint8 value)
 {
 	char v8[1];
 
@@ -196,7 +196,7 @@ int
 }
 
 int
-msn_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value)
+msn_tlvlist_add_16(GSList **list, const guint8 type, const guint16 value)
 {
 	char v16[2];
 
@@ -206,7 +206,7 @@ int
 }
 
 int
-msn_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value)
+msn_tlvlist_add_32(GSList **list, const guint8 type, const guint32 value)
 {
 	char v32[4];
 
@@ -216,19 +216,19 @@ int
 }
 
 int
-msn_tlvlist_add_str(GSList **list, const guint16 type, const char *value)
+msn_tlvlist_add_str(GSList **list, const guint8 type, const char *value)
 {
 	return msn_tlvlist_add_raw(list, type, strlen(value), value);
 }
 
 int
-msn_tlvlist_add_empty(GSList **list, const guint16 type)
+msn_tlvlist_add_empty(GSList **list, const guint8 type)
 {
 	return msn_tlvlist_add_raw(list, type, 0, NULL);
 }
 
 int
-msn_tlvlist_replace_raw(GSList **list, const guint16 type, const guint16 length, const char *value)
+msn_tlvlist_replace_raw(GSList **list, const guint8 type, const guint8 length, const char *value)
 {
 	GSList *cur;
 	msn_tlv_t *tlv;
@@ -257,19 +257,19 @@ int
 }
 
 int
-msn_tlvlist_replace_str(GSList **list, const guint16 type, const char *str)
+msn_tlvlist_replace_str(GSList **list, const guint8 type, const char *str)
 {
 	return msn_tlvlist_replace_raw(list, type, strlen(str), str);
 }
 
 int
-msn_tlvlist_replace_empty(GSList **list, const guint16 type)
+msn_tlvlist_replace_empty(GSList **list, const guint8 type)
 {
 	return msn_tlvlist_replace_raw(list, type, 0, NULL);
 }
 
 int
-msn_tlvlist_replace_8(GSList **list, const guint16 type, const guint8 value)
+msn_tlvlist_replace_8(GSList **list, const guint8 type, const guint8 value)
 {
 	char v8[1];
 
@@ -279,7 +279,7 @@ int
 }
 
 int
-msn_tlvlist_replace_32(GSList **list, const guint16 type, const guint32 value)
+msn_tlvlist_replace_32(GSList **list, const guint8 type, const guint32 value)
 {
 	char v32[4];
 
@@ -289,7 +289,7 @@ void
 }
 
 void
-msn_tlvlist_remove(GSList **list, const guint16 type)
+msn_tlvlist_remove(GSList **list, const guint8 type)
 {
 	GSList *cur, *next;
 	msn_tlv_t *tlv;
@@ -356,7 +356,7 @@ msn_tlv_t *
 }
 
 msn_tlv_t *
-msn_tlv_gettlv(GSList *list, const guint16 type, const int nth)
+msn_tlv_gettlv(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 	int i;
@@ -373,7 +373,7 @@ int
 }
 
 int
-msn_tlv_getlength(GSList *list, const guint16 type, const int nth)
+msn_tlv_getlength(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 
@@ -397,7 +397,7 @@ char *
 }
 
 char *
-msn_tlv_getstr(GSList *list, const guint16 type, const int nth)
+msn_tlv_getstr(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 
@@ -409,7 +409,7 @@ guint8
 }
 
 guint8
-msn_tlv_get8(GSList *list, const guint16 type, const int nth)
+msn_tlv_get8(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 
@@ -421,7 +421,7 @@ guint16
 }
 
 guint16
-msn_tlv_get16(GSList *list, const guint16 type, const int nth)
+msn_tlv_get16(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 
@@ -433,7 +433,7 @@ guint32
 }
 
 guint32
-msn_tlv_get32(GSList *list, const guint16 type, const int nth)
+msn_tlv_get32(GSList *list, const guint8 type, const int nth)
 {
 	msn_tlv_t *tlv;
 
============================================================
--- libpurple/protocols/msn/tlv.h	04f95750057199c9288aa7b52e3923c054b8f75b
+++ libpurple/protocols/msn/tlv.h	d99791c2951a6a9545abf8324f5fb947f879da17
@@ -38,12 +38,12 @@ char *msn_tlv_getvalue_as_string(msn_tlv
 /* TLV handling functions */
 char *msn_tlv_getvalue_as_string(msn_tlv_t *tlv);
 
-msn_tlv_t *msn_tlv_gettlv(GSList *list, const guint16 type, const int nth);
-int msn_tlv_getlength(GSList *list, const guint16 type, const int nth);
-char *msn_tlv_getstr(GSList *list, const guint16 type, const int nth);
-guint8 msn_tlv_get8(GSList *list, const guint16 type, const int nth);
-guint16 msn_tlv_get16(GSList *list, const guint16 type, const int nth);
-guint32 msn_tlv_get32(GSList *list, const guint16 type, const int nth);
+msn_tlv_t *msn_tlv_gettlv(GSList *list, const guint8 type, const int nth);
+int msn_tlv_getlength(GSList *list, const guint8 type, const int nth);
+char *msn_tlv_getstr(GSList *list, const guint8 type, const int nth);
+guint8 msn_tlv_get8(GSList *list, const guint8 type, const int nth);
+guint16 msn_tlv_get16(GSList *list, const guint8 type, const int nth);
+guint32 msn_tlv_get32(GSList *list, const guint8 type, const int nth);
 
 /* TLV list handling functions */
 GSList *msn_tlvlist_read(const char *bs, size_t bs_len);
@@ -55,21 +55,21 @@ void msn_tlvlist_free(GSList *list);
 char *msn_tlvlist_write(GSList *list, size_t *out_len);
 void msn_tlvlist_free(GSList *list);
 
-int msn_tlvlist_add_raw(GSList **list, const guint16 type, const guint16 length, const char *value);
-int msn_tlvlist_add_empty(GSList **list, const guint16 type);
-int msn_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value);
-int msn_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value);
-int msn_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value);
-int msn_tlvlist_add_str(GSList **list, const guint16 type, const char *value);
+int msn_tlvlist_add_raw(GSList **list, const guint8 type, const guint8 length, const char *value);
+int msn_tlvlist_add_empty(GSList **list, const guint8 type);
+int msn_tlvlist_add_8(GSList **list, const guint8 type, const guint8 value);
+int msn_tlvlist_add_16(GSList **list, const guint8 type, const guint16 value);
+int msn_tlvlist_add_32(GSList **list, const guint8 type, const guint32 value);
+int msn_tlvlist_add_str(GSList **list, const guint8 type, const char *value);
 
-int msn_tlvlist_replace_raw(GSList **list, const guint16 type, const guint16 lenth, const char *value);
-int msn_tlvlist_replace_str(GSList **list, const guint16 type, const char *str);
-int msn_tlvlist_replace_empty(GSList **list, const guint16 type);
-int msn_tlvlist_replace_8(GSList **list, const guint16 type, const guint8 value);
-int msn_tlvlist_replace_16(GSList **list, const guint16 type, const guint16 value);
-int msn_tlvlist_replace_32(GSList **list, const guint16 type, const guint32 value);
+int msn_tlvlist_replace_raw(GSList **list, const guint8 type, const guint8 lenth, const char *value);
+int msn_tlvlist_replace_str(GSList **list, const guint8 type, const char *str);
+int msn_tlvlist_replace_empty(GSList **list, const guint8 type);
+int msn_tlvlist_replace_8(GSList **list, const guint8 type, const guint8 value);
+int msn_tlvlist_replace_16(GSList **list, const guint8 type, const guint16 value);
+int msn_tlvlist_replace_32(GSList **list, const guint8 type, const guint32 value);
 
-void msn_tlvlist_remove(GSList **list, const guint16 type);
+void msn_tlvlist_remove(GSList **list, const guint8 type);
 
 #endif /* MSN_TLV_H */
 


More information about the Commits mailing list