pidgin: 43961ded: Add a function to add/replace a TLV to a..
qulogic at pidgin.im
qulogic at pidgin.im
Sat May 7 04:51:35 EDT 2011
----------------------------------------------------------------------
Revision: 43961dedf5aa85dd12c391b7d6fbb0c7e3cf068b
Parent: 24f1253fbd1e01f0f4a6318a194c9195563c599e
Author: qulogic at pidgin.im
Date: 05/07/11 03:28:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/43961dedf5aa85dd12c391b7d6fbb0c7e3cf068b
Changelog:
Add a function to add/replace a TLV to a list.
Changes against parent 24f1253fbd1e01f0f4a6318a194c9195563c599e
patched libpurple/protocols/msn/tlv.c
patched libpurple/protocols/msn/tlv.h
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/tlv.c 8233a38940c13ad8d13b6534e75f04d486f50513
+++ libpurple/protocols/msn/tlv.c 8ce602a1fe0bb1f0ceb70d2f4317bb554858caaa
@@ -228,6 +228,12 @@ int
}
int
+msn_tlvlist_add_tlv(GSList **list, const msn_tlv_t *tlv)
+{
+ return msn_tlvlist_add_raw(list, tlv->type, tlv->length, (const char *)tlv->value);
+}
+
+int
msn_tlvlist_replace_raw(GSList **list, const guint8 type, const guint8 length, const char *value)
{
GSList *cur;
@@ -288,6 +294,12 @@ msn_tlvlist_replace_32(GSList **list, co
return msn_tlvlist_replace_raw(list, type, 4, v32);
}
+int
+msn_tlvlist_replace_tlv(GSList **list, const msn_tlv_t *tlv)
+{
+ return msn_tlvlist_replace_raw(list, tlv->type, tlv->length, (const char *)tlv->value);
+}
+
void
msn_tlvlist_remove(GSList **list, const guint8 type)
{
============================================================
--- libpurple/protocols/msn/tlv.h d99791c2951a6a9545abf8324f5fb947f879da17
+++ libpurple/protocols/msn/tlv.h 06ba5378b51810f44a81c31bcb12cf1590f84d68
@@ -61,6 +61,7 @@ int msn_tlvlist_add_str(GSList **list, c
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_add_tlv(GSList **list, const msn_tlv_t *tlv);
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);
@@ -68,6 +69,7 @@ int msn_tlvlist_replace_32(GSList **list
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);
+int msn_tlvlist_replace_tlv(GSList **list, const msn_tlv_t *tlv);
void msn_tlvlist_remove(GSList **list, const guint8 type);
More information about the Commits
mailing list