Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/packet_parse.c @ 24071:619ac2303c46
2009.10.02 - ccpaging <ccpaging(at)gmail.com>
* Added 'Captcha Display' function
* Most functions from patch written by Emil Alexiev merged into trunk,
except 'buddy operations'
* 'online buddy status' and 'qun buddies' still have problems
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 14:43:46 +0000 |
parents | d57928c9dd8f |
children | c2253c485728 |
comparison
equal
deleted
inserted
replaced
24070:832178d951ca | 24071:619ac2303c46 |
---|---|
149 | 149 |
150 /* pack four bytes as "guint32" into buf | 150 /* pack four bytes as "guint32" into buf |
151 * return the number of bytes packed, otherwise return -1 */ | 151 * return the number of bytes packed, otherwise return -1 */ |
152 gint qq_put32(guint8 *buf, guint32 dw) | 152 gint qq_put32(guint8 *buf, guint32 dw) |
153 { | 153 { |
154 guint32 dw_dest; | |
155 memcpy(&dw_dest, buf, sizeof(dw_dest)); | |
156 | |
154 guint32 dw_porter; | 157 guint32 dw_porter; |
158 dw_porter = g_htonl(dw); | |
159 #ifdef PARSER_DEBUG | |
160 purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf); | |
161 purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter); | |
162 #endif | |
163 memcpy(buf, &dw_porter, sizeof(dw_porter)); | |
164 return sizeof(dw_porter); | |
165 } | |
166 | |
167 gint qq_putime(guint8 *buf, time_t *t) | |
168 { | |
169 guint32 dw, dw_porter; | |
170 memcpy(&dw, t, sizeof(dw)); | |
155 dw_porter = g_htonl(dw); | 171 dw_porter = g_htonl(dw); |
156 #ifdef PARSER_DEBUG | 172 #ifdef PARSER_DEBUG |
157 purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf); | 173 purple_debug_info("QQ", "[DBG][put32] buf %p\n", (void *)buf); |
158 purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter); | 174 purple_debug_info("QQ", "[DBG][put32] dw 0x%08x, dw_porter 0x%08x\n", dw, dw_porter); |
159 #endif | 175 #endif |